Commit Graph
189 Commits
Author SHA1 Message Date
Sebastien Pouliot 240f7e8f1d update System.Net.dll for SL4 API
svn path=/trunk/mcs/; revision=155874
2010-04-21 14:03:45 +00:00
Gonzalo Paniagua Javier 370d27f1df 2010-03-23 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: error handling was totally broken in the synchronous
	Connect() call.  Fixes bug #590488.


svn path=/trunk/mcs/; revision=154087
2010-03-23 20:34:03 +00:00
Sebastien Pouliot 355a27b73d In System.Timers:
2010-03-19  Sebastien Pouliot  <[email protected]>

	* Timer.cs: Removed old NET_2_0 defines and added some new
	MOONLIGHT defines (needed for the client stack)

In System.Net:
2010-03-19  Sebastien Pouliot  <[email protected]>

	* AuthenticationManager.cs: Internal type for Moonlight.
	Add BasicClient, DigestClient, NtlmClient for NET_2_1 since
	this applies to both monotouch and moonlight (client stack).
	Removed unneeded NET_2_0 defines
	* CookieContainer.cs: For Moonlight it needs to be internal in 
	System.dll and public in System.Net.dll. Removed unneeded NET_2_0
	defines
	* HttpContinueDelegate.cs: Internal type for Moonlight.
	* HttpRequestCreator.cs: Remove a MOONLIGHT define
	* HttpStatusCode.cs: For Moonlight it needs to be internal in 
	System.dll and public in System.Net.dll
	* HttpWebRequest.cs: Internal type for Moonlight. Change S.Config
	to NET_2_1 defines (applies to both monotouch and moonlight).
	Removed unneeded NET_2_0 and NET_1_1 defines
	* HttpWebResponse.cs: Internal type for Moonlight. Removed 
	unneeded NET_2_0 defines
	* IAuthenticationModule.cs: Internal type for Moonlight.
	* ICertificatePolicy.cs: Internal type for Moonlight.
	* ICredentialPolicy.cs: Internal type for Moonlight. Removed 
	unneeded NET_2_0 defines
	* IWebRequestCreate.cs: For Moonlight it needs to be internal in 
	System.dll and public in System.Net.dll
	* ServicePoint.cs: Internal type for Moonlight. Change S.Config
	to NET_2_1 defines (applies to both monotouch and moonlight)
	* ServicePointManager.cs: Remove a MOONLIGHT define
	* WebException.cs: For Moonlight it needs to be internal in 
	System.dll and public in System.Net.dll. Removed unneeded NET_2_0
	defines
	* WebHeaderCollection.cs: Internal type for Moonlight. Removed 
	unneeded NET_2_0 defines
	* WebRequest.cs: Internal type for Moonlight. Change S.Config
	to NET_2_1 defines (applies to both monotouch and moonlight)
	* WebResponse.cs: Internal type for Moonlight. Removed unneeded
	NET_2_0 defines

In System.Net.Sockets:
2010-03-19  Sebastien Pouliot  <[email protected]>

	* Socket.cs: Remove some NET_2_0 defines (using) and add a few
	MOONLIGHT defines needed to reuse Socket in the client http stack
	* Socket_2_1.cs: Remove some MOONLIGHT defines
	* SocketAsyncEventArgs.cs: For Moonlight check policy if outside
	System.dll (the client stack use sockets with it's own web 
	xdomain policy)

In System:
2010-03-19  Sebastien Pouliot  <[email protected]>

	* Uri.cs: Remove some MOONLIGHT defines

In .:
2010-03-19  Sebastien Pouliot  <[email protected]>

	* moonlight_*_System.dll.sources: Bring extra types so we can
	build a full, managed, internal HTTP stack to be reused for SL3+
	* Makefile: Add a INSIDE_SYSTEM define when compiling System.dll
	to makes it possible to rebuild the same types in System.Net.dll


svn path=/trunk/mcs/; revision=153916
2010-03-19 19:01:31 +00:00
Jb Evain ba61ae505e use MOONLIGHT symbol
svn path=/trunk/mcs/; revision=153655
2010-03-16 12:07:46 +00:00
Sebastien Pouliot c54a75466f In System/System.Net.Sockets:
2010-03-10  Sebastien Pouliot  <[email protected]>

	* SocketAsyncEventArgs.cs: Remove the use of reflection to check
	xdomain poilicy on sockets (since the policy code now resides in
	System.Net.dll)

In System.Net:
2010-03-10  Sebastien Pouliot  <[email protected]>

	* net_2_1_raw_System.Net.dll.sources: Add types from (new internal)
	System.Net.Policy (moved from System.Windows.Browser.dll)
	* Makefile: Add reference to System.Xml.dll to parse policies

In System.Net/System.Net.Policy:
2010-03-10  Sebastien Pouliot  <[email protected]>

	* BaseDomainPolicy.cs, ClientAccessPolicy[Parser].cs, 
	CrossDomainPolicyManager.cs, FlashCrossDomainPolicy[Parser].cs,
	ICrossDomainPolicy.cs, NoAccessPolicy.cs, PolicyDownloadPolicy.cs,
	SiteOfOriginPolicy.cs: Moved from System.Net.dll with namespace 
	and minor build adjustments.


svn path=/trunk/mcs/; revision=153396
2010-03-10 13:19:46 +00:00
Carlos Alberto Cortez 634b1953a2 2010-01-29 Carlos Alberto Cortez <[email protected]>
* NetworkStream.cs: Our explicit impl of IDisposable.Dispose belongs
	to 1.0/1.1 only. Also move the call to GC.SupressFinalize to
	Dispose(bool), as expected and as done by other Stream children
	implementing a destructor.
	Fixes #564637.


svn path=/trunk/mcs/; revision=150590
2010-01-30 02:26:30 +00:00
Sebastien Pouliot 33bb7e756a 2010-01-21 Sebastien Pouliot <[email protected]>
* SocketAsyncEventArgs.cs: Apply Gendarme's ProtectCallToEventDelegatesRule


svn path=/trunk/mcs/; revision=150033
2010-01-22 01:50:48 +00:00
Sebastien Pouliot f2a2bf9ffb move DnsEndPoint to ease 4.0
svn path=/trunk/mcs/; revision=147700
2009-12-04 20:16:55 +00:00
Gonzalo Paniagua Javier 8c7fc8bf91 2009-11-10 Gonzalo Paniagua Javier <[email protected]>
* Socket_2_1.cs: throw when shutting down a socket that is not
	connected. Don't linger if the socket is not connected.


svn path=/trunk/mcs/; revision=145806
2009-11-10 05:54:00 +00:00
Gonzalo Paniagua Javier 270daddcda 2009-11-03 Gonzalo Paniagua Javier <[email protected]>
* Socket_2_1.cs: stop any blocking thread before closing the socket.


svn path=/trunk/mcs/; revision=145369
2009-11-04 03:31:53 +00:00
Sebastien Pouliot e818e02eee 2009-11-03 Sebastien Pouliot <[email protected]>
* SocketAsyncEventArgs.cs: Set error back to SocketError.Success
	once CheckEndPoint succeed.
	[Fix bug #549586]


svn path=/trunk/mcs/; revision=145329
2009-11-03 21:57:55 +00:00
Gonzalo Paniagua Javier 251a6e2610 2009-10-21 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: implement *SendFile().


svn path=/trunk/mcs/; revision=144510
2009-10-21 06:43:39 +00:00
Sebastien Pouliot 2763f57c1c 2009-09-28 Sebastien Pouliot <[email protected]>
* SocketAsyncEventArgs.cs: Default SocketError.AccessDenied on 
	Connect in case none of the DnsEndPoint provides an adequate 
	address (family).


svn path=/trunk/mcs/; revision=142746
2009-09-28 12:02:47 +00:00
Gonzalo Paniagua Javier 9a6506760a typo
svn path=/trunk/mcs/; revision=142727
2009-09-27 19:24:11 +00:00
Gonzalo Paniagua Javier ede65cd8aa 2009-09-27 Gonzalo Paniagua Javier <[email protected]>
* Socket_2_1.cs: Close(int timeout) blocks up to timeout ms if there's
	pending data to be written to the socket. If there's no pending data,
	it closes and returns right away. Instead of using Timer and then
	doing a 'hard' close(), we set the linget option for the socket.


svn path=/trunk/mcs/; revision=142726
2009-09-27 19:23:24 +00:00
Sebastien Pouliot e0ce50685b 2009-09-27 Sebastien Pouliot <[email protected]>
* SocketAsyncEventArgs.cs: Don't use Socket.Poll for NET_2_1.
	Throw NIE for use of BufferList in Receive.
	* Socket.cs: Move Close(int) to Socket_2_1.cs. Remove NET_2_1
	defines since the file is not used by Moonlight
	* Socket_2_1.cs: Add Close(int) from Socket. Define out Poll
	and Blocking.


svn path=/trunk/mcs/; revision=142722
2009-09-27 14:51:42 +00:00
Sebastien Pouliot 0328ff83e6 In Test/System.Net.Sockets:
2009-09-26  Sebastien Pouliot  <[email protected]>

	* SocketAsyncEventArgsTest.cs: New. Unit tests

In System.Net.Sockets:
2009-09-26  Sebastien Pouliot  <[email protected]>

	* SocketAsyncEventArgs.cs: Fix paramater validations and default 
	values

In .:
2009-09-26  Sebastien Pouliot  <[email protected]>

	* System_test.dll.sources: Add unit tests for SocketAsyncEventArgs


svn path=/trunk/mcs/; revision=142675
2009-09-26 15:27:35 +00:00
Sebastien Pouliot 94a90d2d71 2009-09-23 Sebastien Pouliot <[email protected]>
* Socket_2_1.cs: Remove NET_2_1 socket policy checks from here.
	* SocketAsyncEventArgs.cs: Support DnsEndPoint correctly (NET_2_1 but
	that will be useful for NET_4_0 soon). Add socket policy checks here
	since it could be called several times to connect to a host.


svn path=/trunk/mcs/; revision=142518
2009-09-23 21:39:08 +00:00
Gonzalo Paniagua Javier 855b8e5e8a 2009-09-23 Gonzalo Paniagua Javier <[email protected]>
* NetworkStream.cs: after disposing the stream, CanRead/CanWrite
	return false.


svn path=/trunk/mcs/; revision=142488
2009-09-23 13:41:37 +00:00
Gonzalo Paniagua Javier ea0c9270a9 2009-09-19 Gonzalo Paniagua Javier <[email protected]>
* SocketAsyncEventArgs.cs: fix check for non-null.
	Fixes bug #516455.


svn path=/trunk/mcs/; revision=142252
2009-09-19 05:03:02 +00:00
Geoff Norton d15c42f4ae Revert "2009-08-20 Geoff Norton <[email protected]>"
This reverts commit c33ce01c93fcd9c03021dcd9613cdc8000d84330.

svn path=/trunk/mcs/; revision=141071
2009-09-01 20:39:54 +00:00
Geoff Norton e87b01301c 2009-08-20 Geoff Norton <[email protected]>
* Socket_2_1.cs: Disable ipv6 on monotouch.

svn path=/trunk/mcs/; revision=140368
2009-08-20 20:40:59 +00:00
Sebastien Pouliot 4d12f1bee0 2009-07-14 Sebastien Pouliot <[email protected]>
* Socket_2_1.cs, SocketAsyncEventArgs.cs: A bit more NET_2_1 defines
	to help the tuner remove some extra types for moonlight.


svn path=/trunk/mcs/; revision=137855
2009-07-14 12:21:46 +00:00
Gert Driesen 916aaf1dbb * SocketTest.cs: Added tests for argument checks, and improved tests
for disposed socket.
* Socket.cs: Modified some argument names to match MS. Moved disposed
check before argument checks in Receive. Use SocketError.InvalidArgument
instead of using magic numbers. Added back comments that was 
accidentally removed in my previous commit.
* Socket_2_1.cs: Modified some argument names to match MS.

svn path=/trunk/mcs/; revision=137051
2009-06-28 20:39:25 +00:00
Gert Driesen ba798b342d * System_test.dll.sources: Added IPv6MulticastOptionTest.cs and
MulticastOptionTest.cs.
* Socket.cs: In GetSocketOption, throw SocketException when (byte [])
option value is null. Use SocketError fields instead of using "magic"
number. In SetSocketOption (SocketOptionLevel, SocketOptionName, object)
only accept Linger, AddMembership, DropMembership and verify option
value.
* MulticastOption.cs: Added argument checks. Save interfaceIndex that is
passed to .ctor, and removed MonoTODO. Renamed arguments to match MS.
Reset InterfaceIndex when LocalAddress is modified, and reset
LocalAddress when InterfaceIndex is modified.
* UdpClient.cs: Modified exception to more closely match MS. Fixed
(int, AddressFamily) .ctor to construct IPv6 endpoint when family is
InterNetworkV6. Added null check for multicastAddr to (IPAddress)
JoinMulticastGroup overload. In (int, IPAddress) and (IPAddress,
IPAddress) overloads of JoinMulticastGroup throw SocketException when
client is IPv4. Added null check for multicastAddr to (IPAddress, int),
overload, and moved JoinMulticastGroup call after argument checks.
* IPv6MulticastOption.cs: Renamed argument names to match MS. Added
null check to set_Group. Added range check to set_InterfaceIndex.
* IPv6MulticastOptionTest.cs: Added .ctor and property tests.
* MulticastOptionTest.cs: Added .ctor and property tests.
* SocketTest.cs: Fixed compiler warnings. Improved tests for
closed socket. Added tests fr GetSocketOption, and SetSocketOption
overloads (for Linger, DontLinger, AddMembership and DropMembership).
* UdpClientTest.cs: Added .ctor and JoinMulticastGroup tests.

svn path=/trunk/mcs/; revision=137048
2009-06-28 16:35:54 +00:00
Gonzalo Paniagua Javier 16d1a86aac 2009-06-27 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: turn WSAEINVAL into ArgumentException.


svn path=/trunk/mcs/; revision=137031
2009-06-27 18:02:46 +00:00
Gonzalo Paniagua Javier 433d127533 2009-06-26 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: MS throws a SocketException in the byte[] overload when
	the value is null.


svn path=/trunk/mcs/; revision=136980
2009-06-26 16:34:20 +00:00
Sebastien Pouliot 81c2b840f7 2009-05-22 Sebastien Pouliot <[email protected]>
* Socket_2_1.cs: Do not throw a SecurityException if the security
	policy check fails in NET_2_1 but set the SocketError to AccessDenied
	ensure the EndPoint has a valid policy before connecting.
	* SocketAsyncEventArgs.cs: Don't recurse endlessly in SendCallback
	and ReceiveCallback if the socket is not connected. Check for
	AccessDenied in ConnectCallback (needed for the security policy
	check in NET_2_1).


svn path=/trunk/mcs/; revision=134596
2009-05-22 13:58:03 +00:00
Sebastien Pouliot 16d3fe2785 2009-05-14 Sebastien Pouliot <[email protected]>
* Socket_2_1.cs: Add ConnectAsync support for NET_2_1 which will
	ensure the EndPoint has a valid policy before connecting.
	* SocketAsyncEventArgs.cs: Add support for IList<ArraySegment<byte>>
	when sending. Add ConnectSocket for NET_2_1


svn path=/trunk/mcs/; revision=134171
2009-05-15 00:31:55 +00:00
Gonzalo Paniagua Javier eda5c831df 2009-05-11 Gonzalo Paniagua Javier <[email protected]>
* TcpClient.cs:
	* Socket.cs:
	* UdpClient.cs: use GetHostAddresses() instead of Resolve or
	GetHostEntry.


svn path=/trunk/mcs/; revision=133951
2009-05-12 03:56:03 +00:00
Gonzalo Paniagua Javier acbdd80484 2009-05-11 Gonzalo Paniagua Javier <[email protected]>
* UdpClient.cs: if possible, avoid DNS lookups when the host name is
	an IP address. Related to bug #502866.


svn path=/trunk/mcs/; revision=133944
2009-05-12 03:14:36 +00:00
Gonzalo Paniagua Javier d4bd43145b 2009-04-30 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: return the last error if a connect to multiple addresses
	fails.


svn path=/trunk/mcs/; revision=133252
2009-05-01 03:28:42 +00:00
Sebastien Pouliot eeb4f00cae 2009-04-22 Sebastien Pouliot <[email protected]>
* Socket_2_1.cs: Use old-n-simple CheckProtocolSupport to implement
	OSSupportsIP[v4|v6] for Moonlight (NET_2_1 only) so we can avoid 
	including a bunch of types (22) from System.Net.NetworkInformation 
	and drop the number of [SecuritySafeCritical] methods to audit (the 
	same 22) and [SecurityCritical] (8) beside getting a smaller 
	System.Net.dll assembly :)


svn path=/trunk/mcs/; revision=132408
2009-04-22 21:50:40 +00:00
Gonzalo Paniagua Javier b252d1787c 2009-04-21 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: End* methods can only be called once per IAsyncResult.
	Bug #466031 fixed.


svn path=/trunk/mcs/; revision=132221
2009-04-21 04:48:42 +00:00
Sebastien Pouliot 68dd206d83 In System.Net.Sockets:
2009-04-09  Sebastien Pouliot  <[email protected]>

	* Socket.cs: Split socket class into two files (this one and the
	new Socket_2_1.cs). This let us remove (some) existing #if in the
	sources and avoid (a lot) of new ones for Moonlight.
	* Socket_2_1.cs: Just enough of socket for NET_2_1. This helps
	the tuner not to bring a lot of extra stuff (some visible)
	into Moonlight.
	* SocketAsyncEventArgs.cs: Ifdef out some cases for NET_2_1 so 
	Moonlight can use it's own (smaller) SocketAsyncOperation enum

In .:
2009-04-09  Sebastien Pouliot  <[email protected]>

	* System.dll.sources: Add System.Net.Sockets/Socket_2_1.cs


svn path=/trunk/mcs/; revision=131392
2009-04-09 15:06:42 +00:00
Gonzalo Paniagua Javier 10badb611a 2009-02-17 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: instead of clearing the sockets form the output and then
	adding them back, we just remove the ones that have not been signaled.
	Fixes bug #354090 and bug #476138.


svn path=/trunk/mcs/; revision=127234
2009-02-18 00:35:48 +00:00
Gonzalo Paniagua Javier 8b0ce39175 reverting this patch until it works with bug 354090 and 476138
svn path=/trunk/mcs/; revision=127104
2009-02-17 07:30:29 +00:00
Gonzalo Paniagua Javier 3ab9dba94e 2009-02-11 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: instead of clearing the sockets form the output and then
	adding them back, we just remove the ones that have not been
	signaled.
	Fixes bug #354090.


svn path=/trunk/mcs/; revision=126637
2009-02-11 19:47:29 +00:00
Gonzalo Paniagua Javier 2be8842ab4 2009-01-19 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: don't throw when there's no ipv6 configuration.


svn path=/trunk/mcs/; revision=123832
2009-01-19 22:25:29 +00:00
Dick Porter 5e0ae0a305 2009-01-09 Dick Porter <[email protected]>
* Socket.cs: Special case 0-length receive requests in the
	BeginAccept overloads that wait for data, so they behave as the
	non-waiting version.  Seems to match MS behaviour, fixes bug
	464201.



svn path=/trunk/mcs/; revision=122904
2009-01-09 15:18:50 +00:00
Gonzalo Paniagua Javier 42f4d6e1d2 2009-01-06 Gonzalo Paniagua Javier <[email protected]>
* TcpClient.cs: use IPv6Any when the family is IPv6.
	Bug #462688 fixed.


svn path=/trunk/mcs/; revision=122598
2009-01-07 01:17:08 +00:00
Bill Holmes b5dde2bbdc 2008-12-30 Bill Holmes <[email protected]>
* socket-io.h : Changing the signature of
	  ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
	  the blocking state.

	* icall-def.h :  Changing the signature of
	  System.Net.Sockets.Socket.Accept_internal to pass the blocking state.

	* socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
	  For Windows only.  Avoid blocking when calling accept by
	  querying for a connection via select.  The loop also queries
	  the thread state every 1000 micro seconds for the thread
	  stop state.  This will avoid the process hanging on shutdown
	  when using a TcpChannel that is never connected to.

	* Socket.cs (Accept_internal) :  Changing the signature to pass
	  the blocking state.
	  
	Code is contributed under MIT/X11 license.


svn path=/trunk/mcs/; revision=122252
2008-12-30 16:58:15 +00:00
Miguel de Icaza 67c2ea5d54 Some API updates
svn path=/trunk/mcs/; revision=121931
2008-12-20 18:57:23 +00:00
Gonzalo Paniagua Javier 09dd5ff790 2008-12-20 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: add a new ReceiveFrom_nocheck that does not throw an
	exception in case of error.


svn path=/trunk/mcs/; revision=121923
2008-12-20 10:52:59 +00:00
Gonzalo Paniagua Javier b12fef3814 2008-12-20 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: if Blocking is set, translate a WouldBlock into a
	TimedOut.


svn path=/trunk/mcs/; revision=121922
2008-12-20 10:04:01 +00:00
Gonzalo Paniagua Javier 40ffe194c8 2008-12-03 Gonzalo Paniagua Javier <[email protected]>
* UdpClient.cs: don't Poll() in Receive(), the call to ReceiveFrom
	will block anyway. Fixes bug #455894.


svn path=/trunk/mcs/; revision=120601
2008-12-03 15:33:16 +00:00
Gonzalo Paniagua Javier c25ee5d95b 2008-11-12 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: mark the socket as not connected when there is a pending
	error or exception about to be thrown.
	Bug #443346 fixed.


svn path=/trunk/mcs/; revision=118696
2008-11-13 03:47:23 +00:00
Bill Holmes 017eaee375 2008-09-10 Bill Holmes <[email protected]>
* Socket.cs : Adding a comment to provide locations where
	  changes to MonoSocketAsyncResult need to be synced.

	* Process.cs : Update the fields of ProcessAsyncReader to
	  match MonoSocketAsyncResult metadata/socket-io.h

	Code is contributed under MIT/X11 license.


svn path=/trunk/mcs/; revision=112681
2008-09-10 15:20:35 +00:00
Atsushi Eno 582b946eb0 2008-09-06 Atsushi Enomoto <[email protected]>
* Socket.cs : (SocketAsyncResult) release byte buffer early so that
	  it does not have to store extra data in pool. Fixed bug #397627.


svn path=/trunk/mcs/; revision=112408
2008-09-05 23:53:42 +00:00
Jb Evain e0e4361e63 cleanup System.ComponentModel for SL2
svn path=/trunk/mcs/; revision=109344
2008-07-31 13:49:49 +00:00