From ace38009eec1dccfb27c6acf61a0411ea49cca20 Mon Sep 17 00:00:00 2001 From: Hai Vo <30235741+cloud-hai-vo@users.noreply.github.com> Date: Sun, 23 Aug 2026 00:33:11 +0700 Subject: [PATCH] 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. --- src/Renci.SshNet/Connection/ConnectorBase.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Renci.SshNet/Connection/ConnectorBase.cs b/src/Renci.SshNet/Connection/ConnectorBase.cs index 8dd09f79..7b1da720 100644 --- a/src/Renci.SshNet/Connection/ConnectorBase.cs +++ b/src/Renci.SshNet/Connection/ConnectorBase.cs @@ -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)