|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectforward.server.ForwardConnection
public class ForwardConnection
This is the implementation of the forwarding component between client and the protocol handler. The bandwidth limit is implemented here.
| Field Summary | |
|---|---|
private IStreamConnection |
m_clientConnection
Stores the connection to the client. |
private java.lang.Thread |
m_clientReadThread
Stores the instance of the data transfer thread for the client -> server direction. |
private boolean |
m_closeConnection
Stores whether the ForwardConnection shall be closed. |
private ForwardScheduler |
m_parentScheduler
Stores the scheduler, which controls this ForwardConnection. |
private IProtocolHandler |
m_serverConnection
Stores the protocol handler, which processes the data or forwards them to the mixcascade. |
private java.lang.Thread |
m_serverReadThread
Stores the instance of the data transfer thread for the server -> client direction. |
private java.lang.Thread |
m_timeoutThread
Stores the instance of the thread, which checks for a timeout on the connection. |
private int |
m_transferFromClient
Stores the amount of data which can be transfered on the client -> server direction this round. |
private int |
m_transferFromServer
Stores the amount of data which can be transfered on the server -> client direction this round. |
| Constructor Summary | |
|---|---|
ForwardConnection(IStreamConnection a_clientConnection,
ForwardScheduler a_parentScheduler)
Creates a new ForwardConnection. |
|
| Method Summary | |
|---|---|
void |
allowTransfer(int a_transferBytes)
This method is called by the scheduler to submit, how many bytes can be transfered on this connection in the next round. |
void |
closeConnection()
Closes the connection. |
int |
getAvailableBytes()
Returns the sum of available bytes (bytes which we have already received, but waiting in the incoming buffers for the connection) for the client -> server direction and the server -> client direction. |
ForwardScheduler |
getParentScheduler()
Returns the scheduler for this connection. |
java.lang.String |
toString()
Returns a string representation of this connection It's the IP and the port of the client. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private IStreamConnection m_clientConnection
private IProtocolHandler m_serverConnection
private ForwardScheduler m_parentScheduler
private boolean m_closeConnection
private int m_transferFromClient
private int m_transferFromServer
private java.lang.Thread m_clientReadThread
private java.lang.Thread m_serverReadThread
private java.lang.Thread m_timeoutThread
| Constructor Detail |
|---|
public ForwardConnection(IStreamConnection a_clientConnection,
ForwardScheduler a_parentScheduler)
throws java.lang.Exception
a_clientConnection - The Socket with the active connection to the client.a_parentScheduler - The scheduler which controls this connection.
java.lang.Exception| Method Detail |
|---|
public int getAvailableBytes()
public ForwardScheduler getParentScheduler()
public void closeConnection()
public void allowTransfer(int a_transferBytes)
a_transferBytes - The bytes which can be transfered on this connection in the next
round.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||