Class TunnelTransport<P extends Packet<?>>
java.lang.Object
com.hierynomus.smbj.transport.tcp.tunnel.TunnelTransport<P>
- Type Parameters:
P-
- All Implemented Interfaces:
TransportLayer<P>
A Transport that translates the actual remote address to a connection on 'localhost' on the specified port.
This is useful for when using an SSH tunnel.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTunnelTransport(TransportLayer<P> tunnel, String tunnelHost, int tunnelPort) -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect(InetSocketAddress remoteAddress) Connect to the remote sidevoidDisconnect from the remote sidebooleanChecks if the transport layer is currently connected.voidWrite the packet to the transport.
-
Field Details
-
tunnel
-
tunnelHost
-
tunnelPort
private int tunnelPort
-
-
Constructor Details
-
TunnelTransport
-
-
Method Details
-
write
Description copied from interface:TransportLayerWrite the packet to the transport.- Specified by:
writein interfaceTransportLayer<P extends Packet<?>>- Parameters:
packet- The packet to write.- Throws:
TransportException
-
connect
Description copied from interface:TransportLayerConnect to the remote side- Specified by:
connectin interfaceTransportLayer<P extends Packet<?>>- Parameters:
remoteAddress- The remote address to connect to- Throws:
IOException
-
disconnect
Description copied from interface:TransportLayerDisconnect from the remote side- Specified by:
disconnectin interfaceTransportLayer<P extends Packet<?>>- Throws:
IOException
-
isConnected
public boolean isConnected()Description copied from interface:TransportLayerChecks if the transport layer is currently connected.- Specified by:
isConnectedin interfaceTransportLayer<P extends Packet<?>>
-