rice.pastry.wire
Class SocketManager.SocketConnector

java.lang.Object
  |
  +--rice.pastry.wire.SocketManager.SocketConnector
Enclosing class:
SocketManager

private class SocketManager.SocketConnector
extends java.lang.Object

Private class which is tasked with reading the greeting message off of a newly connected socket. This greeting message says who the socket is coming from, and allows the connected to hand the socket off the appropriate node handle.


Field Summary
private  java.nio.channels.SelectionKey key
           
private  rice.pastry.wire.SocketChannelReader reader
           
private  SocketChannelWriter writer
           
 
Constructor Summary
SocketManager.SocketConnector(java.nio.channels.SelectionKey key)
          Constructor
 
Method Summary
private  void debug(java.lang.String s)
           
 void read()
          Reads from the socket attached to this connector.
 void write()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

private java.nio.channels.SelectionKey key

reader

private rice.pastry.wire.SocketChannelReader reader

writer

private SocketChannelWriter writer
Constructor Detail

SocketManager.SocketConnector

public SocketManager.SocketConnector(java.nio.channels.SelectionKey key)
Constructor

Parameters:
key - The key to read from
Method Detail

read

public void read()
          throws java.io.IOException
Reads from the socket attached to this connector. It first reads the first 4 bytes, containing the size of the greeting message. It then allocates enough space to read the greeting message, and does so.

java.io.IOException

write

public void write()
           throws java.io.IOException
java.io.IOException

debug

private void debug(java.lang.String s)