diff options
author | monojenkins <jo.shields+jenkins@xamarin.com> | 2015-12-16 14:35:02 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2015-12-16 14:35:02 +0300 |
commit | 431334491983b99f9390b1ccb9ee11322365b548 (patch) | |
tree | 439c70e855c405e5aeb043997afa14183126cd15 /mcs | |
parent | 9dc34141e190d9b5521ca3be8e52335b0521d0ae (diff) | |
parent | b78f3f6f0733b4c62f772ebbe87f3c9612340713 (diff) |
Merge pull request #2351 from ludovic-henry/fix-socket-36941
[socket] Add test for SocketOptionName.MulticastTimeToLive
Diffstat (limited to 'mcs')
-rwxr-xr-x | mcs/class/System/Test/System.Net.Sockets/SocketTest.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs index c38da668521..9ee0c544769 100755 --- a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs +++ b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs @@ -4327,6 +4327,19 @@ namespace MonoTests.System.Net.Sockets client.Receive (bytes, bytes.Length, 0); client.Close (); } + + [Test] + public void UdpMulticasTimeToLive () + { + /* see https://bugzilla.xamarin.com/show_bug.cgi?id=36941 */ + + using (Socket socket = new Socket (AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) { + IPEndPoint end_point = new IPEndPoint (IPAddress.Any, 11000); + socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, 1); + socket.Bind (end_point); + socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 19); + } + } } } |