Imported Upstream version 5.18.0.142

Former-commit-id: 7467d4b717762eeaf652d77f1486dd11ffb1ff1f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-09 08:20:59 +00:00
parent e52655b4dc
commit 0abdbe5a7d
1547 changed files with 93792 additions and 47893 deletions

View File

@ -392,6 +392,11 @@ namespace System.Net.Sockets
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern static SocketAddress RemoteEndPoint_internal (IntPtr socket, int family, out int error);
internal SafeHandle SafeHandle
{
get { return m_Handle; }
}
#endregion
#region Select
@ -1172,6 +1177,10 @@ namespace System.Net.Sockets
DnsEndPoint dep = e.RemoteEndPoint as DnsEndPoint;
if (dep != null) {
addresses = Dns.GetHostAddresses (dep.Host);
if (dep.AddressFamily == AddressFamily.Unspecified)
return true;
int last_valid = 0;
for (int i = 0; i < addresses.Length; ++i) {
if (addresses [i].AddressFamily != dep.AddressFamily)
@ -1374,6 +1383,14 @@ namespace System.Net.Sockets
return ret;
}
public int Receive (Span<byte> buffer, SocketFlags socketFlags)
{
byte[] tempBuffer = new byte[buffer.Length];
int ret = Receive (tempBuffer, SocketFlags.None);
tempBuffer.CopyTo (buffer);
return ret;
}
public bool ReceiveAsync (SocketAsyncEventArgs e)
{
// NO check is made whether e != null in MS.NET (NRE is thrown in such case)
@ -1860,6 +1877,11 @@ namespace System.Net.Sockets
return ret;
}
public int Send (ReadOnlySpan<byte> buffer, SocketFlags socketFlags)
{
return Send (buffer.ToArray(), socketFlags);
}
public bool SendAsync (SocketAsyncEventArgs e)
{
// NO check is made whether e != null in MS.NET (NRE is thrown in such case)