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 TypeMethodDescriptionvoid
connect
(InetSocketAddress remoteAddress) Connect to the remote sidevoid
Disconnect from the remote sideboolean
Checks if the transport layer is currently connected.void
Write the packet to the transport.
-
Field Details
-
tunnel
-
tunnelHost
-
tunnelPort
private int tunnelPort
-
-
Constructor Details
-
TunnelTransport
-
-
Method Details
-
write
Description copied from interface:TransportLayer
Write the packet to the transport.- Specified by:
write
in interfaceTransportLayer<P extends Packet<?>>
- Parameters:
packet
- The packet to write.- Throws:
TransportException
-
connect
Description copied from interface:TransportLayer
Connect to the remote side- Specified by:
connect
in interfaceTransportLayer<P extends Packet<?>>
- Parameters:
remoteAddress
- The remote address to connect to- Throws:
IOException
-
disconnect
Description copied from interface:TransportLayer
Disconnect from the remote side- Specified by:
disconnect
in interfaceTransportLayer<P extends Packet<?>>
- Throws:
IOException
-
isConnected
public boolean isConnected()Description copied from interface:TransportLayer
Checks if the transport layer is currently connected.- Specified by:
isConnected
in interfaceTransportLayer<P extends Packet<?>>
-