public class Connection extends Object implements Runnable, AgentMonitor
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_DESTINATION_PORT
The default destination terminal server port number.
|
protected Socket |
destSocket
A socket for the host's connection.
|
protected AgentOut |
fromDestToSrc
An AgentOut object for the connection to the host.
|
protected AgentIn |
fromSrcToDest
An AgentIn object for the connection to the client.
|
protected Date |
sessionStarted
When the connection object was created
|
protected Socket |
srcSocket
A socket for the client's connection.
|
| Constructor and Description |
|---|
Connection(Socket srcSocket,
ConnectionMonitor cm,
boolean encryption)
Called as soon as the server socket receives a request on this port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
agentHasDied(AgentIn a)
Called when the connection to the client is lost.
|
void |
agentHasDied(AgentOut a)
Called when the connection to the host is lost.
|
String |
getDestHost()
Returns the destination terminal server host name.
|
int |
getDestPort()
DOCUMENT ME!
|
String |
getSrcHost()
DOCUMENT ME!
|
void |
kill(boolean removeSelf)
Kills current connection, halts the
Connection thread. |
void |
run()
Starts the connection thread.
|
public static final int DEFAULT_DESTINATION_PORT
protected AgentIn fromSrcToDest
AgentInprotected AgentOut fromDestToSrc
AgentOutprotected Date sessionStarted
protected Socket destSocket
protected Socket srcSocket
public Connection(Socket srcSocket, ConnectionMonitor cm, boolean encryption)
srcSocket - Socket representing the clients request.cm - ConnectionMonitor object to provide feedback on the
connections state.encryption - on/off(t/f)public void agentHasDied(AgentIn a)
agentHasDied in interface AgentMonitora - The connection to the client.AgentInpublic void agentHasDied(AgentOut a)
agentHasDied in interface AgentMonitora - the connection to the host.AgentOutpublic String getDestHost()
public int getDestPort()
public String getSrcHost()
public void kill(boolean removeSelf)
Connection thread.
Removes current connection from the connection monitor.Copyright © 2013. All Rights Reserved.