Package net.schmizz.sshj
Class SocketClient
java.lang.Object
net.schmizz.sshj.SocketClient
- Direct Known Subclasses:
SSHClient
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final intprivate final intprivate Stringprivate InputStreamprivate OutputStreamprivate intprivate Socketprivate SocketFactoryprivate intprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidconnect(String hostname, int port, InetAddress localAddr, int localPort) voidconnect(InetAddress host) voidconnect(InetAddress host, int port) voidconnect(InetAddress host, int port, InetAddress localAddr, int localPort) voidconnectVia(Channel channel, String hostname, int port) voidconnectVia(DirectConnection directConnection) Connect to a remote address via a direct TCP/IP connection from the server.voidint(package private) InputStreamint(package private) OutputStreamintintbooleanprotected InetSocketAddressmakeInetSocketAddress(String hostname, int port) (package private) voidvoidsetConnectTimeout(int connectTimeout) voidsetSocketFactory(SocketFactory factory) voidsetTimeout(int timeout)
-
Field Details
-
defaultPort
private final int defaultPort -
socket
-
input
-
output
-
socketFactory
-
DEFAULT_CONNECT_TIMEOUT
private static final int DEFAULT_CONNECT_TIMEOUT- See Also:
-
connectTimeout
private int connectTimeout -
timeout
private int timeout -
hostname
-
port
private int port -
tunneled
private boolean tunneled
-
-
Constructor Details
-
SocketClient
SocketClient(int defaultPort)
-
-
Method Details
-
makeInetSocketAddress
-
connect
- Throws:
IOException
-
connect
- Throws:
IOException
-
connect
public void connect(String hostname, int port, InetAddress localAddr, int localPort) throws IOException - Throws:
IOException
-
connectVia
- Throws:
IOException
-
connectVia
Connect to a remote address via a direct TCP/IP connection from the server.- Throws:
IOException
-
connect
- Throws:
IOException
-
connect
- Throws:
IOException
-
connect
public void connect(InetAddress host, int port, InetAddress localAddr, int localPort) throws IOException - Throws:
IOException
-
disconnect
- Throws:
IOException
-
isConnected
public boolean isConnected() -
getLocalPort
public int getLocalPort() -
getLocalAddress
-
getRemoteHostname
-
getRemotePort
public int getRemotePort() -
getRemoteAddress
-
setSocketFactory
-
getSocketFactory
-
getConnectTimeout
public int getConnectTimeout() -
setConnectTimeout
public void setConnectTimeout(int connectTimeout) -
getTimeout
public int getTimeout() -
setTimeout
public void setTimeout(int timeout) -
getSocket
-
getInputStream
InputStream getInputStream() -
getOutputStream
OutputStream getOutputStream() -
onConnect
- Throws:
IOException
-