Package net.schmizz.sshj
Class SocketClient
java.lang.Object
net.schmizz.sshj.SocketClient
- Direct Known Subclasses:
SSHClient
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private static final int
private final int
private String
private InputStream
private OutputStream
private int
private Socket
private SocketFactory
private int
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
connect
(String hostname, int port, InetAddress localAddr, int localPort) void
connect
(InetAddress host) void
connect
(InetAddress host, int port) void
connect
(InetAddress host, int port, InetAddress localAddr, int localPort) void
connectVia
(Channel channel, String hostname, int port) void
connectVia
(DirectConnection directConnection) Connect to a remote address via a direct TCP/IP connection from the server.void
int
(package private) InputStream
int
(package private) OutputStream
int
int
boolean
protected InetSocketAddress
makeInetSocketAddress
(String hostname, int port) (package private) void
void
setConnectTimeout
(int connectTimeout) void
setSocketFactory
(SocketFactory factory) void
setTimeout
(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
-