Skip to content

Commit 4632a33

Browse files
committed
Increase timeout waiting for buffered read data.
1 parent 1bab13b commit 4632a33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Renci.SshNet/Abstractions/SocketAbstraction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static Socket Connect(IPEndPoint remoteEndpoint, TimeSpan connectTimeout)
8181

8282
public static void ClearReadBuffer(Socket socket)
8383
{
84-
var timeout = TimeSpan.FromMilliseconds(10);
84+
var timeout = TimeSpan.FromMilliseconds(500);
8585
var buffer = new byte[256];
8686
int bytesReceived;
8787

@@ -289,7 +289,7 @@ public static int Read(Socket socket, byte[] buffer, int offset, int size, TimeS
289289
throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
290290
"Socket read operation has timed out after {0:F0} milliseconds.", timeout.TotalMilliseconds));
291291

292-
throw;
292+
throw;
293293
}
294294
}
295295
while (totalBytesRead < totalBytesToRead);

0 commit comments

Comments
 (0)