From 08ab36bc773b1c270585d8020a65d6cd5e84a207 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Thu, 8 Oct 2015 09:47:04 -0700 Subject: Remove tcpNoDelay setting This conflicts with more advanced proxy transports that don't support this, so just remove it altogether. --- .../src/main/java/com/trilead/ssh2/Connection.java | 25 ---------------------- .../trilead/ssh2/transport/TransportManager.java | 11 ---------- 2 files changed, 36 deletions(-) (limited to 'sshlib') diff --git a/sshlib/src/main/java/com/trilead/ssh2/Connection.java b/sshlib/src/main/java/com/trilead/ssh2/Connection.java index 8582ea4..1f605e0 100644 --- a/sshlib/src/main/java/com/trilead/ssh2/Connection.java +++ b/sshlib/src/main/java/com/trilead/ssh2/Connection.java @@ -105,8 +105,6 @@ public class Connection private TransportManager tm; - private boolean tcpNoDelay = false; - private ProxyData proxyData = null; private Vector connectionMonitors = new Vector(); @@ -812,8 +810,6 @@ public class Connection "The connect() operation on the socket timed out.").initCause(se); } - tm.setTcpNoDelay(tcpNoDelay); - /* Wait until first KEX has finished */ ConnectionInfo ci = tm.getConnectionInfo(1); @@ -1408,27 +1404,6 @@ public class Connection cryptoWishList.serverHostKeyAlgorithms = algos; } - /** - * Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm) on the - * underlying socket. - *

- * Can be called at any time. If the connection has not yet been established - * then the passed value will be stored and set after the socket has been - * set up. The default value that will be used is false. - * - * @param enable - * the argument passed to the Socket.setTCPNoDelay() - * method. - * @throws IOException - */ - public synchronized void setTCPNoDelay(boolean enable) throws IOException - { - tcpNoDelay = enable; - - if (tm != null) - tm.setTcpNoDelay(enable); - } - /** * Used to tell the library that the connection shall be established through * a proxy server. It only makes sense to call this method before calling diff --git a/sshlib/src/main/java/com/trilead/ssh2/transport/TransportManager.java b/sshlib/src/main/java/com/trilead/ssh2/transport/TransportManager.java index 8f3406e..b991f3c 100644 --- a/sshlib/src/main/java/com/trilead/ssh2/transport/TransportManager.java +++ b/sshlib/src/main/java/com/trilead/ssh2/transport/TransportManager.java @@ -7,7 +7,6 @@ import java.io.OutputStream; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; -import java.net.SocketTimeoutException; import java.net.UnknownHostException; import java.security.SecureRandom; import java.util.Vector; @@ -156,16 +155,6 @@ public class TransportManager return tc.getPacketOverheadEstimate(); } - public void setTcpNoDelay(boolean state) throws IOException - { - sock.setTcpNoDelay(state); - } - - public void setSoTimeout(int timeout) throws IOException - { - sock.setSoTimeout(timeout); - } - public ConnectionInfo getConnectionInfo(int kexNumber) throws IOException { return km.getOrWaitForConnectionInfo(kexNumber); -- cgit v1.2.3