diff options
author | Bill Holmes <bill.holmes@unity3d.com> | 2021-06-10 15:53:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-10 15:53:09 +0300 |
commit | 4208c224955a4959b17fd68d0c8ae1db19f0dc46 (patch) | |
tree | 6beac49c93e2ad402abda12596c76576eeee8138 /mcs/class/System/System.Net.NetworkInformation/Ping.cs | |
parent | 34e5b025ac6027a98df2e99f6b7cd1121f9f21b4 (diff) |
Increase the buffer size for ping reply (#21069)
Avoid Windows socket error code WSAEMSGSIZE when receiving the ping
reply for larger sent payloads.
Diffstat (limited to 'mcs/class/System/System.Net.NetworkInformation/Ping.cs')
-rw-r--r-- | mcs/class/System/System.Net.NetworkInformation/Ping.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mcs/class/System/System.Net.NetworkInformation/Ping.cs b/mcs/class/System/System.Net.NetworkInformation/Ping.cs index 59b635fb95c..eee697801d4 100644 --- a/mcs/class/System/System.Net.NetworkInformation/Ping.cs +++ b/mcs/class/System/System.Net.NetworkInformation/Ping.cs @@ -249,11 +249,11 @@ namespace System.Net.NetworkInformation { var sw = Stopwatch.StartNew (); // receive - bytes = new byte [100]; + bytes = new byte [bytes.Length + 40]; do { EndPoint endpoint = target; SocketError error = 0; - int rc = s.ReceiveFrom (bytes, 0, 100, SocketFlags.None, + int rc = s.ReceiveFrom (bytes, 0, bytes.Length, SocketFlags.None, ref endpoint, out error); if (error != SocketError.Success) { |