|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.dyade.aaa.agent.NGNetwork.CnxHandler
class NGNetwork.CnxHandler
Nested Class Summary | |
---|---|
(package private) class |
NGNetwork.CnxHandler.MessageInputStream
Class used to read messages through a stream. |
(package private) class |
NGNetwork.CnxHandler.MessageOutputStream
Class used to send messages through a stream. |
Field Summary | |
---|---|
(package private) java.nio.ByteBuffer |
bufin
Informations for input |
(package private) java.nio.ByteBuffer |
bufout
|
(package private) java.nio.channels.SocketChannel |
channel
The communication socket channel |
(package private) long |
lasttry
Date of last connection attempt |
private boolean |
local
True if a "local" connection is in progress, a local connection is initiated from this server to the remote one (defined by the server descriptor. |
(package private) NGNetwork.CnxHandler.MessageInputStream |
mis
|
(package private) NGNetwork.CnxHandler.MessageOutputStream |
mos
|
private java.lang.String |
name
The handler's name. |
(package private) int |
nbwrite
Informations for output |
(package private) NGNetwork.MessageVector |
sendlist
FIFO list of all messages to be sent |
private ServerDesc |
server
The description of the remote server handled by this network session |
private short |
sid
Destination server id |
Constructor Summary | |
---|---|
NGNetwork.CnxHandler(java.lang.String name,
short sid)
|
Method Summary | |
---|---|
private void |
ack(int stamp)
|
(package private) void |
close()
|
private void |
doAck(int ack)
Removes all messages in sendList previous to the ack'ed one. |
java.lang.String |
getName()
Returns this session's name. |
(package private) void |
init()
|
(package private) boolean |
localStart()
Its method is called by start in order to initiate a connection from the local server. |
private void |
read()
Method called each time the channel is Readable |
(package private) boolean |
remoteStart(java.nio.channels.SocketChannel channel,
int boot)
Its method is called by start in order to reply to a connection request from a remote server. |
(package private) void |
send(Message msg)
|
(package private) void |
start()
|
private void |
startEnd()
The session is well initialized, we can start the server thread that "listen" the connected socket. |
java.lang.String |
toString()
|
private void |
write()
Method called each time the channel is Writable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private short sid
private java.lang.String name
private boolean local
server
descriptor.
This attribute is used to synchronize local and remote attempts to
make connections.
private ServerDesc server
java.nio.channels.SocketChannel channel
long lasttry
int nbwrite
NGNetwork.CnxHandler.MessageOutputStream mos
java.nio.ByteBuffer bufout
NGNetwork.MessageVector sendlist
java.nio.ByteBuffer bufin
NGNetwork.CnxHandler.MessageInputStream mis
Constructor Detail |
---|
NGNetwork.CnxHandler(java.lang.String name, short sid) throws java.io.IOException
java.io.IOException
Method Detail |
---|
void init() throws java.io.IOException, UnknownServerException
java.io.IOException
UnknownServerException
public final java.lang.String getName()
void start() throws java.io.IOException
java.io.IOException
boolean localStart()
In order to overide the protocol, we have to implements its method, with the remoteStart and the transmit methods.
boolean remoteStart(java.nio.channels.SocketChannel channel, int boot)
sock
- the connected socketois
- the input streamoos
- the output stream
private void startEnd() throws java.io.IOException
java.io.IOException
void send(Message msg) throws java.io.IOException
java.io.IOException
private void write() throws java.io.IOException
java.io.IOException
private void read() throws java.lang.Exception
java.lang.Exception
private final void doAck(int ack) throws java.io.IOException
java.io.IOException
private final void ack(int stamp) throws java.lang.Exception
java.lang.Exception
void close() throws java.io.IOException
java.io.IOException
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 |