Package com.trilead.ssh2.transport
Class Acceptor
java.lang.Object
com.trilead.ssh2.Connection
com.trilead.ssh2.transport.Acceptor
This class is similar to
Connection but is
used to accept incoming connections from clients.
Example use-cases are 'NETCONF Call Home' or
'reverse SSH'.-
Field Summary
Fields inherited from class com.trilead.ssh2.Connection
connectionMonitors, cryptoWishList, dhgexpara, hostname, identification, port, proxyData, tcpNoDelay, tm -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept(ServerHostKeyVerifier verifier, int connectTimeout, int readTimeout, int kexTimeout) This method reuses most of methods forConnection.connect(ServerHostKeyVerifier, int, int, int).Methods inherited from class com.trilead.ssh2.Connection
addConnectionMonitor, authenticateWithAgent, authenticateWithDSA, authenticateWithGssapiWithMic, authenticateWithKeyboardInteractive, authenticateWithKeyboardInteractive, authenticateWithNone, authenticateWithPassword, authenticateWithPublicKey, authenticateWithPublicKey, cancelRemotePortForwarding, close, connect, connect, connect, connect, createLocalPortForwarder, createLocalPortForwarder, createLocalStreamForwarder, createSCPClient, enableDebugging, exec, forceKeyExchange, getAvailableCiphers, getAvailableMACs, getAvailableServerHostKeyAlgorithms, getBanners, getConnectionInfo, getHostname, getOrCreateSecureRND, getPort, getReasonClosedCause, getRemainingAuthMethods, getVersionInfo, isAuthenticationComplete, isAuthenticationPartialSuccess, isAuthMethodAvailable, openSession, ping, requestRemotePortForwarding, sendIgnorePacket, sendIgnorePacket, setClient2ServerCiphers, setClient2ServerMACs, setDHGexParameters, setProxyData, setSecureRandom, setServer2ClientCiphers, setServer2ClientMACs, setServerHostKeyAlgorithms, setTCPNoDelay
-
Constructor Details
-
Acceptor
Constuctor- Parameters:
hostname- is the hostname that this class is running on.port- is the port that is used for incoming connections.
-
-
Method Details
-
accept
public ConnectionInfo accept(ServerHostKeyVerifier verifier, int connectTimeout, int readTimeout, int kexTimeout) throws IOException This method reuses most of methods forConnection.connect(ServerHostKeyVerifier, int, int, int). Parameters and descriptions applies here too. The main difference between this class andConnectionis that we useServerSocketand we bind with the port specified in constructor. TheServerSocket.accept()will wait (blocks) for an incoming connection for max . If connection is completed aSocketis returned and we set a timeout of this socket using .- Throws:
SocketTimeoutException- If there is no incoming connection within .IOException
-