Commit Graph
71 Commits
Author SHA1 Message Date
Gonzalo Paniagua Javier 47cc2b607d [socket] Fixed other BeginConnect overloads
The BeginConnect overload taking an IPAddress[] was not really
	asynchronous.
2011-04-26 11:02:22 -04:00
Sebastien Pouliot 966a4e1990 Fix buffer checks on Socket.[Receive|Send]Async
* System.Net.Sockets/Socket_2_1.cs: Fix, by explicitely throwing an NRE,
the checks in [Receive|Send]Async methods - otherwise an exception would
occur later, on another thread and close the socket (leading to other,
unexpected, exceptions)

* Test/System.Net.Sockets/SocketTest.cs: Add parameter validation test
cases for both ReceiveAsync and SendAsync
2010-09-29 14:33:20 -04:00
Sebastien Pouliot c3b5cb557e Add test case to show a different behavior (from Windows) wrt Socket buffers
* Test/System.Net.Sockets/SocketTest.cs: Add test case where buffers can
be set to 0 under Windows (but has a 256 bytes minimum on Linux)
2010-09-23 17:10:05 -04:00
Gonzalo Paniagua Javier 884680ede3 LocalEndPoint works now for non-blocking connects
We didn't keep the endpoint around for non-blocking connects and later,
	when Poll() was called, we didn't have the information. Also 'isbound'
	wasn't being set in a few places and UDP sockets needed to be marked as
	not connected after a call to Connect() with an Any address.

	Removed an old test for Connect(Any) with UDP sockets, since this is
	used to disconnect them now.

	Fixes bug #640749.
2010-09-22 12:39:07 -04:00
Gonzalo Paniagua Javier 3efb4c4a29 new test
svn path=/trunk/mcs/; revision=145809
2009-11-10 05:56:22 +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
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 1c7df92ca0 new test
svn path=/trunk/mcs/; revision=137033
2009-06-27 18:03:35 +00:00
Gonzalo Paniagua Javier 72754e7d4d 2009-06-26 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs: tests for DontLinger.


svn path=/trunk/mcs/; revision=136982
2009-06-26 16:34:58 +00:00
Robert Jordan 2f26089775 2009-06-26 Robert Jordan <[email protected]>
* *.cs: Upgrade to new NUnit style.


svn path=/trunk/mcs/; revision=136949
2009-06-26 12:20:08 +00:00
Miguel de Icaza a87e065bae Add test for bug 471580
svn path=/trunk/mcs/; revision=125822
2009-02-05 05:58:23 +00:00
Gonzalo Paniagua Javier ca31518c5a 2009-01-26 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs:
	(TestSelect1) avoid RST by reading the bytes from the client.

svn path=/trunk/mcs/; revision=124463
2009-01-26 07:00:46 +00:00
Geoff Norton 067bd1817a 2009-01-07 Geoff Norton <[email protected]>
* SocketTest.cs: Disable some tests on the Mac that rely on socket
        options that are unavailable.

svn path=/trunk/mcs/; revision=122625
2009-01-07 07:04:44 +00:00
Gonzalo Paniagua Javier ee9a2c680c 2008-12-03 Gonzalo Paniagua Javier <[email protected]>
* UdpClientTest.cs: test closing a UDP socket while receiving.


svn path=/trunk/mcs/; revision=120603
2008-12-03 15:34:37 +00:00
Gonzalo Paniagua Javier 8a9f05d723 fix the build
svn path=/trunk/mcs/; revision=118736
2008-11-13 17:24:00 +00:00
Gonzalo Paniagua Javier 0b00587d8a 2008-11-12 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs: added test case based on the one in bug
	#443346.


svn path=/trunk/mcs/; revision=118697
2008-11-13 03:48:52 +00:00
Dick Porter d99d4af2ff 2008-06-19 Dick Porter <[email protected]>
* Socket.cs: Implement generic Send() and Receive() methods.
	Fixes bug 395168.

2008-06-19  Dick Porter  <[email protected]>

	* SocketTest.cs: Tests for generic Send() and Receive() methods.



svn path=/trunk/mcs/; revision=106198
2008-06-19 11:50:42 +00:00
Miguel de Icaza 6bcdaef726 2008-04-17 Miguel de Icaza <[email protected]>
* NetworkStream.cs: Throw an IOException if the socket is not
	connected, not an ArgumentException.   

	Fixes #371923, it is also the way its documented on MSDN. 

svn path=/trunk/mcs/; revision=101082
2008-04-17 22:39:29 +00:00
Arina Itkes ddaf734d6a Fix for 9491 bug. Socket should not throw exception when it closed by another thread.
svn path=/trunk/mcs/; revision=91709
2007-12-20 14:30:11 +00:00
Gert Driesen e99f202f1f * UdpClientTest.cs: Fixed line endings.
svn path=/trunk/mcs/; revision=90184
2007-11-22 19:13:19 +00:00
Arina Itkes 0d0309405c TARGET_JVM: Move Category NotWorking to CloseTest instead of TcpClient
svn path=/trunk/mcs/; revision=90143
2007-11-22 10:47:30 +00:00
Arina Itkes c5c44ce2af TARGET_JVM: mark some tests with NotWorking under TARGET_JVM
svn path=/trunk/mcs/; revision=90140
2007-11-22 10:33:32 +00:00
Zoltan Varga 151117371d 2007-11-02 Zoltan Varga <[email protected]>
* SocketTest.cs: Disable the send/receive buffer size tests.

svn path=/trunk/mcs/; revision=88728
2007-11-02 16:25:00 +00:00
Dick Porter e3c85ecc7b 2007-10-30 Dick Porter <[email protected]>
* UdpClient.cs: Don't set the multicast option twice.  Fixes bug
	324033.

2007-10-30  Dick Porter  <[email protected]>

	* UdpClientTest.cs: Test for 324033.



svn path=/trunk/mcs/; revision=88456
2007-10-30 13:55:11 +00:00
Robert Jordan 30ca8e180b In System.Net.Sockets:
2007-10-21  Robert Jordan  <[email protected]>

	* Socket.cs: Remove GetHashCode override from the NET_2_0
	profile. Add LAMESPEC comment. Fixes bug #325113.

In Test/System.Net.Sockets:
2007-10-21  Robert Jordan  <[email protected]>

	* SocketTest.cs: Enable GetHashCodeTest.


svn path=/trunk/mcs/; revision=87865
2007-10-21 11:59:00 +00:00
Gert Driesen c457862b7d * SocketTest.cs: Improved EndConnect test. Added test for bug #82446,
and marked it NotWorking for 2.0 profile.

svn path=/trunk/mcs/; revision=84155
2007-08-15 15:52:09 +00:00
Dick Porter 64e7cb9b84 2007-05-14 Dick Porter <[email protected]>
* SocketTest.cs: Tests for bug 75705



svn path=/trunk/mcs/; revision=77362
2007-05-14 15:22:31 +00:00
Gert Driesen 13b7e81515 * SocketResponder.cs: Thread-safety fixes.
* TcpClientTest.cs: Enabled test for bug #81105.

svn path=/trunk/mcs/; revision=76068
2007-04-22 16:19:52 +00:00
Gert Driesen 9b688e5d1e * TcpClientTest.cs: ... and disable it again, since it fails buildbot
sles-9 x86-64.

svn path=/trunk/mcs/; revision=76022
2007-04-20 19:46:01 +00:00
Gert Driesen 9dc8fb6d4d * TcpClientTest.cs: Re-enabled test for bug #81105 since it passes
on both linux and windows. I'll monitor the build bots to spot if it
breaks the tests.

svn path=/trunk/mcs/; revision=76020
2007-04-20 18:43:10 +00:00
Miguel de Icaza 4addb2731e Flag as not working for now
svn path=/trunk/mcs/; revision=74338
2007-03-15 05:10:26 +00:00
Gert Driesen 155199945b * TcpClient.cs: Do not initialize network stream in Connect. In
Dispose, only nullify client if network stream was not obtained.
Fixes bug #81105.
* TcpClientTest.cs: Added test for bug #81105.

svn path=/trunk/mcs/; revision=74062
2007-03-11 13:02:52 +00:00
Vladimir Krasnov 4a1093a70a * removed tests with not supported calls for TARGET_JVM because of validation failures
svn path=/trunk/mcs/; revision=73886
2007-03-07 13:45:42 +00:00
Ilya Kharmatsky 8002cee3a2 Ignoring non working tests, eol fix in SocketTest.jvm.cs
svn path=/trunk/mcs/; revision=72470
2007-02-08 12:50:36 +00:00
Ilya Kharmatsky e7a54460e9 Added SocketTest.jvm.cs - as a fork of SocketTest.cs, due to a big number of 'TARGET_JVM' specific changes.
svn path=/trunk/mcs/; revision=72028
2007-01-31 15:07:34 +00:00
Dick Porter 75ed1e07ec 2007-01-26 Dick Porter <[email protected]>
* Socket.cs: There's no point checking the SO_ERROR status of a
	socket after poll() or select() if we already know that connected
	== true.

2007-01-26  Dick Porter  <[email protected]>

	* SocketTest.cs: New test for SO_ERROR reading, returning the same
	value over and over.



svn path=/trunk/mcs/; revision=71751
2007-01-26 14:27:47 +00:00
Ilya Kharmatsky 9461572c1f Added 'Ignore' attribute under TARGET_JVM directive.
svn path=/trunk/mcs/; revision=71661
2007-01-25 11:26:04 +00:00
Dick Porter 164ee390b7 2007-01-24 Dick Porter <[email protected]>
* NetworkStream.cs: 2.0 profile updates, based on a patch by
	Sridhar Kulkarni ([email protected])

2007-01-24  Dick Porter  <[email protected]>

	* NetworkStreamTest.cs: Test 2.0 ReadTimeout property



svn path=/trunk/mcs/; revision=71598
2007-01-24 15:26:47 +00:00
Dick Porter 9dfddd1985 2007-01-23 Dick Porter <[email protected]>
* TcpListener.cs: 2.0 profile updates, based on a patch by Sridhar
	Kulkarni ([email protected])

2007-01-23  Dick Porter  <[email protected]>

	* TcpListenerTest.cs: Test 2.0 Start(int) overload



svn path=/trunk/mcs/; revision=71565
2007-01-23 21:40:58 +00:00
Dick Porter f75e3a4aac 2007-01-23 Dick Porter <[email protected]>
* TcpClient.cs: 2.0 profile updates, based on a patch by Sridhar
	Kulkarni ([email protected])

2007-01-23  Dick Porter  <[email protected]>

	* TcpClientTest.cs: Test 2.0 Connect(IPAddress[], port) overload



svn path=/trunk/mcs/; revision=71557
2007-01-23 21:08:28 +00:00
Miguel de Icaza 0c11e8adb9 Make this work with some linux kernels
svn path=/trunk/mcs/; revision=71378
2007-01-20 03:31:29 +00:00
Dick Porter cbb74edc89 2007-01-11 Dick Porter <[email protected]>
* SocketTest.cs: 
	* UdpClientTest.cs: Test 2.0 additions



svn path=/trunk/mcs/; revision=70854
2007-01-11 13:31:42 +00:00
Dick Porter f4a529ee38 2006-11-24 Dick Porter <[email protected]>
* SocketTest.cs: Add a test for async non blocking connects that
        should fail, leaving Socket.Connected == false.  Based on test
        case in bug 79878.



svn path=/trunk/mcs/; revision=68433
2006-11-24 15:49:43 +00:00
Andrew Skiba d0ac2b8307 exclude stuff for TARGET_JVM
svn path=/trunk/mcs/; revision=67937
2006-11-15 16:27:54 +00:00
Gonzalo Paniagua Javier 41a8bb1168 2005-09-27 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs: added a bunch of tests expecting
	ObjectDisposedException to be thrown.


svn path=/trunk/mcs/; revision=50889
2005-09-27 21:08:14 +00:00
Ben Maurer 0e8decdb37 remove svn:executable from .cs files
svn path=/trunk/mcs/; revision=46562
2005-06-27 15:51:40 +00:00
Gonzalo Paniagua Javier fd02ac62fa 2005-06-20 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs: added new test for Select.


svn path=/trunk/mcs/; revision=46235
2005-06-20 08:27:12 +00:00
Gert Driesen ce2cd9cf8b * SocketTest.cs: added test for bug #75158.
svn path=/trunk/mcs/; revision=45420
2005-06-04 21:26:32 +00:00
Gonzalo Paniagua Javier 7ad9468745 enable test as 75154 is fixed now
svn path=/trunk/mcs/; revision=45410
2005-06-04 18:09:43 +00:00