games.strategy.net.nio
Interface NIOSocketListener

All Known Implementing Classes:
ClientMessenger, ServerMessenger

public interface NIOSocketListener

Call backs for an NIO Socket


Method Summary
 INode getLocalNode()
          Get the node id for the local machine, or null if the remote node is not yet known.
 INode getRemoteNode(java.nio.channels.SocketChannel channel)
          Get the remote node id for this channel, or null if the remote node id is not yet known.
 void messageReceived(MessageHeader message, java.nio.channels.SocketChannel channel)
           
 void socketError(java.nio.channels.SocketChannel channel, java.lang.Exception error)
          An error occured on the channel and it was shut down.
 void socketUnqaurantined(java.nio.channels.SocketChannel channel, QuarantineConversation conversation)
          This connection will leave quarantine.
 

Method Detail

socketUnqaurantined

void socketUnqaurantined(java.nio.channels.SocketChannel channel,
                         QuarantineConversation conversation)
This connection will leave quarantine. Messages on this channel will not be read until after this method returns, allowing for setup of the channel.


socketError

void socketError(java.nio.channels.SocketChannel channel,
                 java.lang.Exception error)
An error occured on the channel and it was shut down.


messageReceived

void messageReceived(MessageHeader message,
                     java.nio.channels.SocketChannel channel)

getRemoteNode

INode getRemoteNode(java.nio.channels.SocketChannel channel)
Get the remote node id for this channel, or null if the remote node id is not yet known. The node may be unknown if the channel is still quarantined


getLocalNode

INode getLocalNode()
Get the node id for the local machine, or null if the remote node is not yet known. The node must be known by the time we have an unquarantined channel.