Class TunnelTransport<P extends Packet<?>>
- java.lang.Object
-
- com.hierynomus.smbj.transport.tcp.tunnel.TunnelTransport<P>
-
- Type Parameters:
P-
- All Implemented Interfaces:
TransportLayer<P>
public class TunnelTransport<P extends Packet<?>> extends java.lang.Object implements 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.
-
-
Constructor Summary
Constructors Constructor Description TunnelTransport(TransportLayer<P> tunnel, java.lang.String tunnelHost, int tunnelPort)
-
Method Summary
Modifier and Type Method Description voidconnect(java.net.InetSocketAddress remoteAddress)Connect to the remote sidevoiddisconnect()Disconnect from the remote sidebooleanisConnected()Checks if the transport layer is currently connected.voidwrite(P packet)Write the packet to the transport.
-
-
-
Constructor Detail
-
TunnelTransport
public TunnelTransport(TransportLayer<P> tunnel, java.lang.String tunnelHost, int tunnelPort)
-
-
Method Detail
-
write
public void write(P packet) throws TransportException
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
public void connect(java.net.InetSocketAddress remoteAddress) throws java.io.IOExceptionDescription copied from interface:TransportLayerConnect to the remote side- Specified by:
connectin interfaceTransportLayer<P extends Packet<?>>- Parameters:
remoteAddress- The remote address to connect to- Throws:
java.io.IOException
-
disconnect
public void disconnect() throws java.io.IOExceptionDescription copied from interface:TransportLayerDisconnect from the remote side- Specified by:
disconnectin interfaceTransportLayer<P extends Packet<?>>- Throws:
java.io.IOException
-
isConnected
public boolean isConnected()
Description copied from interface:TransportLayerChecks if the transport layer is currently connected.- Specified by:
isConnectedin interfaceTransportLayer<P extends Packet<?>>
-
-