mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-10 01:05:42 +00:00
Always let the OS auto-tune the socket send/receive buffer size (#1821)
Remove the explicit SendBufferSize/ReceiveBufferSize assignment from both SocketConnect and SocketConnectAsync. This lets the operating system auto-tune the buffer for every connection by default, and resolves the sync/async multiplier mismatch.
This commit is contained in:
@@ -47,9 +47,6 @@ namespace Renci.SshNet.Connection
|
||||
{
|
||||
SocketAbstraction.Connect(socket, endPoint, timeout);
|
||||
|
||||
const int socketBufferSize = 10 * Session.MaximumSshPacketSize;
|
||||
socket.SendBufferSize = socketBufferSize;
|
||||
socket.ReceiveBufferSize = socketBufferSize;
|
||||
return socket;
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -77,9 +74,6 @@ namespace Renci.SshNet.Connection
|
||||
{
|
||||
await SocketAbstraction.ConnectAsync(socket, endPoint, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
const int socketBufferSize = 2 * Session.MaximumSshPacketSize;
|
||||
socket.SendBufferSize = socketBufferSize;
|
||||
socket.ReceiveBufferSize = socketBufferSize;
|
||||
return socket;
|
||||
}
|
||||
catch (Exception)
|
||||
|
||||
Reference in New Issue
Block a user