Package com.trilead.ssh2.transport
Class TransportManager
java.lang.Object
com.trilead.ssh2.transport.TransportManager
TransportManager.
- Version:
- $Id: TransportManager.java,v 1.2 2008/04/01 12:38:09 cplattne Exp $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
(package private) class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Vector
private Thread
(package private) Vector
(package private) final Object
(package private) boolean
(package private) String
(package private) KexManager
private static final Logger
static final int
Advertised maximum SSH packet size that the other side can send to us.(package private) Vector
(package private) boolean
(package private) int
(package private) Throwable
(package private) Thread
(package private) final Socket
private final String
(package private) TransportConnection
private ClientServerHello
-
Constructor Summary
ConstructorsConstructorDescriptionTransportManager
(String host, int port) TransportManager
(String host, int port, String sourceAddress) -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeRecvCipher
(BlockCipher bc, MAC mac) void
changeSendCipher
(BlockCipher bc, MAC mac) void
private InetAddress
createInetAddress
(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
private void
establishConnection
(ProxyData proxyData, int connectTimeout, int readTimeout) void
forceKeyExchange
(CryptoWishList cwl, DHGexParameters dhgex) getConnectionInfo
(int kexNumber) int
If the socket connection is lost (either by this side closing down or the other side closing down),byte[]
void
initialize
(CryptoWishList cwl, ServerHostKeyVerifier verifier, DHGexParameters dhgex, int connectTimeout, int readTimeout, SecureRandom rnd, ProxyData proxyData) void
initialize
(CryptoWishList cwl, ServerHostKeyVerifier verifier, DHGexParameters dhgex, int connectTimeout, SecureRandom rnd, ProxyData proxyData) boolean
void
private InetAddress
parseIPv4Address
(String host) void
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
(Vector monitors) void
setSoTimeout
(int timeout) void
setTcpNoDelay
(boolean state)
-
Field Details
-
log
-
asynchronousQueue
-
asynchronousThread
-
sourceAddress
-
hostname
String hostname -
port
int port -
sock
-
connectionSemaphore
-
flagKexOngoing
boolean flagKexOngoing -
reasonClosedCause
Throwable reasonClosedCause -
tc
-
km
KexManager km -
messageHandlers
Vector messageHandlers -
receiveThread
Thread receiveThread -
connectionMonitors
Vector connectionMonitors -
monitorsWereInformed
boolean monitorsWereInformed -
versions
-
MAX_PACKET_SIZE
public static final int MAX_PACKET_SIZEAdvertised maximum SSH packet size that the other side can send to us.
-
-
Constructor Details
-
TransportManager
- Throws:
IOException
-
TransportManager
- Throws:
IOException
-
-
Method Details
-
createInetAddress
There were reports that there are JDKs which use the resolver even though one supplies a dotted IP address in the Socket constructor. That is why we try to generate the InetAdress "by hand".- Parameters:
host
-- Returns:
- the InetAddress
- Throws:
UnknownHostException
-
parseIPv4Address
- Throws:
UnknownHostException
-
getPacketOverheadEstimate
public int getPacketOverheadEstimate() -
setTcpNoDelay
- Throws:
IOException
-
setSoTimeout
- Throws:
IOException
-
getConnectionInfo
- Throws:
IOException
-
getVersionInfo
-
getReasonClosedCause
If the socket connection is lost (either by this side closing down or the other side closing down),- Returns:
- a non-null object indicating the cause of the connection loss.
-
isConnectionClosed
public boolean isConnectionClosed() -
getSessionIdentifier
public byte[] getSessionIdentifier() -
close
-
establishConnection
private void establishConnection(ProxyData proxyData, int connectTimeout, int readTimeout) throws IOException - Throws:
IOException
-
initialize
public void initialize(CryptoWishList cwl, ServerHostKeyVerifier verifier, DHGexParameters dhgex, int connectTimeout, SecureRandom rnd, ProxyData proxyData) throws IOException - Throws:
IOException
-
initialize
public void initialize(CryptoWishList cwl, ServerHostKeyVerifier verifier, DHGexParameters dhgex, int connectTimeout, int readTimeout, SecureRandom rnd, ProxyData proxyData) throws IOException - Throws:
IOException
-
registerMessageHandler
-
removeMessageHandler
-
sendKexMessage
- Throws:
IOException
-
ensureConnected
- Throws:
IOException
-
kexFinished
- Throws:
IOException
-
forceKeyExchange
- Throws:
IOException
-
changeRecvCipher
-
changeSendCipher
-
sendAsynchronousMessage
- Throws:
IOException
-
setConnectionMonitors
-
sendMessage
- Throws:
IOException
-
receiveLoop
- Throws:
IOException
-