|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface SocketFactory
A factory for (client) sockets.
This works similar to SocketFactory, but with the
ability to replace/wrap the Streams without having to subclass
Socket (and it works with before JDK 1.4, too).
An application may pass an implementation of this interface to the Session to control the creation of outgoing Sockets for port forwardings (to other hosts/ports on the local side) or for the main connection to the remote host.
ServerSocketFactory,
Session.setSocketFactory(com.jcraft.jsch.SocketFactory),
Session.setPortForwardingR(String, int, String, int, SocketFactory)| Method Summary | |
|---|---|
Socket |
createSocket(String host,
int port)
Creates a Socket connected to a given host/port. |
InputStream |
getInputStream(Socket socket)
Creates an InputStream for a Socket. |
OutputStream |
getOutputStream(Socket socket)
Creates an OutputStream for a Socket. |
| Method Detail |
|---|
Socket createSocket(String host,
int port)
throws IOException,
UnknownHostException
host - the destination host name.port - the destination port number.
IOException
UnknownHostException
InputStream getInputStream(Socket socket)
throws IOException
return socket.getInputStream(),
but advanced implementations may wrap the stream.
socket - a socket created with createSocket(java.lang.String, int).
IOException
OutputStream getOutputStream(Socket socket)
throws IOException
return socket.getOutputStream(),
but advanced implementations may wrap the stream.
socket - a socket created with createSocket(java.lang.String, int).
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||