Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Holmes <bill.holmes@unity3d.com>2021-06-10 15:53:09 +0300
committerGitHub <noreply@github.com>2021-06-10 15:53:09 +0300
commit4208c224955a4959b17fd68d0c8ae1db19f0dc46 (patch)
tree6beac49c93e2ad402abda12596c76576eeee8138
parent34e5b025ac6027a98df2e99f6b7cd1121f9f21b4 (diff)
Increase the buffer size for ping reply (#21069)
Avoid Windows socket error code WSAEMSGSIZE when receiving the ping reply for larger sent payloads.
-rw-r--r--mcs/class/System/System.Net.NetworkInformation/Ping.cs4
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) {