public class TCPConnectionHandler extends Object implements gr.uoa.di.madgik.commons.server.ITCPConnectionManagerEntry
TCPConnectionManager in order to
receive incoming TCP connection from clients. This entry is set to serve connections for the
gRS2 component| Constructor and Description |
|---|
TCPConnectionHandler() |
| Modifier and Type | Method and Description |
|---|---|
gr.uoa.di.madgik.commons.server.ITCPConnectionManagerEntry.NamedEntry |
GetName() |
void |
HandleConnection(Socket socket) |
public gr.uoa.di.madgik.commons.server.ITCPConnectionManagerEntry.NamedEntry GetName()
The connection manager entry this handler can serve. The entry returned is marked
with ITCPConnectionManagerEntry.NamedEntry.gRS2
GetName in interface gr.uoa.di.madgik.commons.server.ITCPConnectionManagerEntryITCPConnectionManagerEntry.GetName()public void HandleConnection(Socket socket)
After a request of the correct type has reached TCPConnectionManager, it is forwarded here
where the specific IBuffer and its serving IMirror is located. The request is
forwarded to the IMirror and the operation is completed in this thread of execution. In
the IMirror thread of execution, the mirroring protocol is initiated and served.
The IMirror that is expected by this handler is one that manages TCP connections, the
TCPWriterMirror over which the TCPWriterMirror.setSocket(Socket) and
TCPWriterMirror.setKey(String) is set before a call to TCPWriterMirror.handle()
is invoked.
If the state of the TCPWriterMirror thread is not Thread.State.NEWm then the connection
is discarded as there is already a mirroring process in progress
HandleConnection in interface gr.uoa.di.madgik.commons.server.ITCPConnectionManagerEntryITCPConnectionManagerEntry.HandleConnection(java.net.Socket)Copyright © 2014. All Rights Reserved.