public class SocketWrapper extends Object implements SshTransport, SocketTimeoutSupport
| Constructor and Description |
|---|
SocketWrapper(Socket socket)
Create a SocketWrapper
|
SocketWrapper(Socket socket,
String originalHostname) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the channel.
|
SshTransport |
duplicate()
Create a new copy of this transport and connect to the
same host:port combination.
|
String |
getHost()
Get the name of the connected host.
|
InputStream |
getInputStream()
Get an InputStream to read incoming channel data.
|
OutputStream |
getOutputStream()
Get an OutputStream to write outgoing channel data.
|
int |
getPort()
Get the port of this connection
|
Socket |
getSocket() |
int |
getSoTimeout()
Get the current socket timeout in milliseconds.
|
void |
setSoTimeout(int timeout)
Set the socket timeout in milliseconds.
|
protected Socket socket
public SocketWrapper(Socket socket)
socket - public InputStream getInputStream() throws IOException
SshIOgetInputStream in interface SshIOIOExceptionpublic OutputStream getOutputStream() throws IOException
SshIOgetOutputStream in interface SshIOIOExceptionpublic String getHost()
SshTransportgetHost in interface SshTransportpublic int getPort()
SshTransportgetPort in interface SshTransportpublic void close()
throws IOException
SshIOclose in interface SshIOSshIOExceptionIOExceptionpublic SshTransport duplicate() throws IOException
SshTransportduplicate in interface SshTransportIOExceptionpublic void setSoTimeout(int timeout)
throws IOException
SocketTimeoutSupportsetSoTimeout in interface SocketTimeoutSupporttimeout - intIOExceptionpublic int getSoTimeout()
throws IOException
SocketTimeoutSupportgetSoTimeout in interface SocketTimeoutSupportIOExceptionpublic Socket getSocket()
Copyright © 2025. All rights reserved.