Socket.ConnectAsync uses BeginConnect, and ends here in
ConnectCallback. It needs to call EndConnect so any error can be
propagated up.
See Xamarin bug: https://bugzilla.xamarin.com/show_bug.cgi?id=21017
The WaitOne () call has a tendency to time out on the Jenkins
VMs. However, reproducing the problem outside of Jenkins has
proven futile.
This makes the WaitOne () call block for as long as needed and
still fails the test if the elapsed time was longer than 30s.
We print the actual elapsed time to the console.
Hopefully this'll help us find out if it's just taking quite a
long time to run or if it's a hang.
Without this, three of the tests fail on Linux kernels without IPv6
support.
This is a minimal fix, copy'n'pasting a conditional which was used in
other tests. It might be nicer to factor out the SupportsIPv6 to its
own utility function.
Previously, many tests just had a return statement when the test shouldn't
be executed (e.g. Unix-only). This made it look like the test was successful
when in fact it wasn't executed at all.
Assert.Ignore() is now used instead to correctly exclude those tests.
* configure.in: Check for if_nametoindex().
* socket-io.c (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
Mac OS doesn't allow interface = 0; use the interface id from the first
non-loopback interface.
* UdpClientTest.cs: Enable JoinMulticastGroup1_IPv6,
JoinMulticastGroup2_IPv6 and JoinMulticastGroup3_IPv6 on the Mac.
* configure.in: Add check for getifaddrs().
* socket-io.c: Implement get_local_ips() using getifaddrs()
if SIOCGIFCONF is not available.
* DnsTest.cs: Add GetHostEmpty_StringEmpty().
* UdpClientTest.cs(): Enable Available(), BeginReceive() and BeginSend()
on the Mac.
* 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
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.
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
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