public class SocketWrapper extends Object implements SshTransport, SocketTimeoutSupport
Constructor and Description |
---|
SocketWrapper(Socket socket)
Create a SocketWrapper
|
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
SshIO
getInputStream
in interface SshIO
IOException
public OutputStream getOutputStream() throws IOException
SshIO
getOutputStream
in interface SshIO
IOException
public String getHost()
SshTransport
getHost
in interface SshTransport
public int getPort()
SshTransport
getPort
in interface SshTransport
public void close() throws IOException
SshIO
close
in interface SshIO
SshIOException
IOException
public SshTransport duplicate() throws IOException
SshTransport
duplicate
in interface SshTransport
IOException
public void setSoTimeout(int timeout) throws IOException
SocketTimeoutSupport
setSoTimeout
in interface SocketTimeoutSupport
timeout
- intIOException
public int getSoTimeout() throws IOException
SocketTimeoutSupport
getSoTimeout
in interface SocketTimeoutSupport
IOException
public Socket getSocket()
Copyright © 2024. All rights reserved.