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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect(java.net.InetSocketAddress remoteAddress)
Connect to the remote sidevoid
disconnect()
Disconnect from the remote sideboolean
isConnected()
Checks if the transport layer is currently connected.void
write(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:TransportLayer
Write the packet to the transport.- Specified by:
write
in interfaceTransportLayer<P extends Packet<?>>
- Parameters:
packet
- The packet to write.- Throws:
TransportException
-
connect
public void connect(java.net.InetSocketAddress remoteAddress) throws java.io.IOException
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:
java.io.IOException
-
disconnect
public void disconnect() throws java.io.IOException
Description copied from interface:TransportLayer
Disconnect from the remote side- Specified by:
disconnect
in interfaceTransportLayer<P extends Packet<?>>
- Throws:
java.io.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<?>>
-
-