Imported Upstream version 6.0.0.172

Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-04-12 14:10:50 +00:00
parent 8016999e4d
commit 64ac736ec5
32155 changed files with 3981439 additions and 75368 deletions

View File

@ -885,7 +885,7 @@ namespace MonoTests.System.Net.Sockets {
#endif
public void CloseInReceive ()
{
UdpClient client = new UdpClient (NetworkHelpers.FindFreePort ());
UdpClient client = new UdpClient (0);
ManualResetEvent ready = new ManualResetEvent (false);
bool got_exc = false;
@ -1024,8 +1024,8 @@ namespace MonoTests.System.Net.Sockets {
#endif
public void BeginReceive ()
{
var port = NetworkHelpers.FindFreePort ();
UdpClient client = new UdpClient (port);
UdpClient client = new UdpClient (0);
var port = ((IPEndPoint) client.Client.LocalEndPoint).Port;
BRCalledBack.Reset ();
@ -1053,8 +1053,8 @@ namespace MonoTests.System.Net.Sockets {
#endif
public void Available ()
{
var port = NetworkHelpers.FindFreePort ();
using (UdpClient client = new UdpClient (port)) {
using (UdpClient client = new UdpClient (0)) {
var port = ((IPEndPoint) client.Client.LocalEndPoint).Port;
IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, port);
byte[] bytes = new byte[] {10, 11, 12, 13};
@ -1149,10 +1149,9 @@ namespace MonoTests.System.Net.Sockets {
if (!Socket.OSSupportsIPv6)
Assert.Ignore ("IPv6 not enabled.");
int port1 = NetworkHelpers.FindFreePort ();
int port2 = NetworkHelpers.FindFreePort ();
using(var udpClient = new UdpClient (port1, AddressFamily.InterNetworkV6))
using(var udpClient2 = new UdpClient (port2, AddressFamily.InterNetworkV6))
using(var udpClient = new UdpClient (0, AddressFamily.InterNetworkV6)) {
var port1 = ((IPEndPoint) udpClient.Client.LocalEndPoint).Port;
using(var udpClient2 = new UdpClient (0, AddressFamily.InterNetworkV6))
{
var dataSent = new byte [] {1,2,3};
udpClient2.SendAsync (dataSent, dataSent.Length, "::1", port1);
@ -1162,6 +1161,7 @@ namespace MonoTests.System.Net.Sockets {
Assert.AreEqual (dataSent.Length, data.Length);
}
}
}
/* No test for Ttl default as it is platform dependent */