public class TransportManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
TransportManager.AsynchronousWorker |
(package private) class |
TransportManager.HandlerEntry |
Modifier and Type | Field and Description |
---|---|
private java.util.Vector |
asynchronousQueue |
private java.lang.Thread |
asynchronousThread |
(package private) java.util.Vector |
connectionMonitors |
(package private) java.lang.Object |
connectionSemaphore |
(package private) boolean |
flagKexOngoing |
(package private) java.lang.String |
hostname |
(package private) KexManager |
km |
private static Logger |
log |
static int |
MAX_PACKET_SIZE
Advertised maximum SSH packet size that the other side can send to us.
|
(package private) java.util.Vector |
messageHandlers |
(package private) boolean |
monitorsWereInformed |
(package private) int |
port |
(package private) java.lang.Throwable |
reasonClosedCause |
(package private) java.lang.Thread |
receiveThread |
(package private) java.net.Socket |
sock |
(package private) TransportConnection |
tc |
private ClientServerHello |
versions |
Constructor and Description |
---|
TransportManager(java.lang.String host,
int port) |
Modifier and Type | Method and Description |
---|---|
void |
changeRecvCipher(BlockCipher bc,
MAC mac) |
void |
changeSendCipher(BlockCipher bc,
MAC mac) |
void |
close(java.lang.Throwable cause,
boolean useDisconnectPacket) |
private java.net.InetAddress |
createInetAddress(java.lang.String host)
There were reports that there are JDKs which use
the resolver even though one supplies a dotted IP
address in the Socket constructor.
|
private void |
ensureConnected() |
private void |
establishConnection(ProxyData proxyData,
int connectTimeout,
int readTimeout) |
void |
forceKeyExchange(CryptoWishList cwl,
DHGexParameters dhgex) |
ConnectionInfo |
getConnectionInfo(int kexNumber) |
int |
getPacketOverheadEstimate() |
java.lang.Throwable |
getReasonClosedCause()
If the socket connection is lost (either by this side closing down or the other side closing down),
return a non-null object indicating the cause of the connection loss.
|
byte[] |
getSessionIdentifier() |
ClientServerHello |
getVersionInfo() |
void |
initialize(CryptoWishList cwl,
ServerHostKeyVerifier verifier,
DHGexParameters dhgex,
int connectTimeout,
int readTimeout,
java.security.SecureRandom rnd,
ProxyData proxyData) |
void |
initialize(CryptoWishList cwl,
ServerHostKeyVerifier verifier,
DHGexParameters dhgex,
int connectTimeout,
java.security.SecureRandom rnd,
ProxyData proxyData) |
boolean |
isConnectionClosed() |
void |
kexFinished() |
private java.net.InetAddress |
parseIPv4Address(java.lang.String host) |
void |
receiveLoop() |
void |
registerMessageHandler(MessageHandler mh,
int low,
int high) |
void |
removeMessageHandler(MessageHandler mh,
int low,
int high) |
void |
sendAsynchronousMessage(byte[] msg) |
void |
sendKexMessage(byte[] msg) |
void |
sendMessage(byte[] msg) |
void |
setConnectionMonitors(java.util.Vector monitors) |
void |
setSoTimeout(int timeout) |
void |
setTcpNoDelay(boolean state) |
private static final Logger log
private final java.util.Vector asynchronousQueue
private java.lang.Thread asynchronousThread
java.lang.String hostname
int port
final java.net.Socket sock
final java.lang.Object connectionSemaphore
boolean flagKexOngoing
java.lang.Throwable reasonClosedCause
TransportConnection tc
KexManager km
java.util.Vector messageHandlers
java.lang.Thread receiveThread
java.util.Vector connectionMonitors
boolean monitorsWereInformed
private ClientServerHello versions
public static final int MAX_PACKET_SIZE
public TransportManager(java.lang.String host, int port) throws java.io.IOException
java.io.IOException
private java.net.InetAddress createInetAddress(java.lang.String host) throws java.net.UnknownHostException
host
- java.net.UnknownHostException
private java.net.InetAddress parseIPv4Address(java.lang.String host) throws java.net.UnknownHostException
java.net.UnknownHostException
public int getPacketOverheadEstimate()
public void setTcpNoDelay(boolean state) throws java.io.IOException
java.io.IOException
public void setSoTimeout(int timeout) throws java.io.IOException
java.io.IOException
public ConnectionInfo getConnectionInfo(int kexNumber) throws java.io.IOException
java.io.IOException
public ClientServerHello getVersionInfo()
public java.lang.Throwable getReasonClosedCause()
public boolean isConnectionClosed()
public byte[] getSessionIdentifier()
public void close(java.lang.Throwable cause, boolean useDisconnectPacket)
private void establishConnection(ProxyData proxyData, int connectTimeout, int readTimeout) throws java.io.IOException
java.io.IOException
public void initialize(CryptoWishList cwl, ServerHostKeyVerifier verifier, DHGexParameters dhgex, int connectTimeout, java.security.SecureRandom rnd, ProxyData proxyData) throws java.io.IOException
java.io.IOException
public void initialize(CryptoWishList cwl, ServerHostKeyVerifier verifier, DHGexParameters dhgex, int connectTimeout, int readTimeout, java.security.SecureRandom rnd, ProxyData proxyData) throws java.io.IOException
java.io.IOException
public void registerMessageHandler(MessageHandler mh, int low, int high)
public void removeMessageHandler(MessageHandler mh, int low, int high)
public void sendKexMessage(byte[] msg) throws java.io.IOException
java.io.IOException
private void ensureConnected() throws java.io.IOException
java.io.IOException
public void kexFinished() throws java.io.IOException
java.io.IOException
public void forceKeyExchange(CryptoWishList cwl, DHGexParameters dhgex) throws java.io.IOException
java.io.IOException
public void changeRecvCipher(BlockCipher bc, MAC mac)
public void changeSendCipher(BlockCipher bc, MAC mac)
public void sendAsynchronousMessage(byte[] msg) throws java.io.IOException
java.io.IOException
public void setConnectionMonitors(java.util.Vector monitors)
public void sendMessage(byte[] msg) throws java.io.IOException
java.io.IOException
public void receiveLoop() throws java.io.IOException
java.io.IOException