|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.socket.SocketChannelRepeater
public class SocketChannelRepeater
Class which serves as an "reader" for messages sent across the wire via the Pastry socket protocol. This class builds up an object as it is being sent across the wire, and when it has recieved all of an object, it informs the WirePastryNode by using the recieveMessage(msg) method. The SocketChannelReader is designed to be reused, to read objects continiously off of one stream.
Field Summary | |
---|---|
protected int |
REPEATER_BUFFER_SIZE
|
Constructor Summary | |
---|---|
SocketChannelRepeater(SocketPastryNode spn,
SocketCollectionManager.SourceRouteManager manager)
Constructor which creates this SocketChannelReader and the WirePastryNode. |
Method Summary | |
---|---|
static EpochInetSocketAddress[] |
decodeFullHeader(byte[] array,
int num)
|
static EpochInetSocketAddress |
decodeHeader(byte[] array)
Method which can be used to decode the necessary header for the intermediate hop |
static EpochInetSocketAddress |
decodeHeader(byte[] array,
int offset)
Method which can be used to decode the necessary header for the intermediate hop |
boolean |
read(java.nio.channels.SocketChannel sc)
Method which is to be called when there is data available on the specified SocketChannel. |
boolean |
write(java.nio.channels.SocketChannel sc)
Method which is designed to be called when this repeater should write something out. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int REPEATER_BUFFER_SIZE
Constructor Detail |
---|
public SocketChannelRepeater(SocketPastryNode spn, SocketCollectionManager.SourceRouteManager manager)
spn
- The PastryNode the SocketChannelReader serves.Method Detail |
---|
public static EpochInetSocketAddress decodeHeader(byte[] array) throws java.io.IOException
array
- The encoded header
java.io.IOException
public static EpochInetSocketAddress[] decodeFullHeader(byte[] array, int num) throws java.io.IOException
java.io.IOException
public static EpochInetSocketAddress decodeHeader(byte[] array, int offset) throws java.io.IOException
array
- The encoded header
java.io.IOException
public boolean read(java.nio.channels.SocketChannel sc) throws java.io.IOException
sc
- The channel to read from.
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic boolean write(java.nio.channels.SocketChannel sc) throws java.io.IOException
sc
- The SocketChannel to write to
java.io.IOException
- DESCRIBE THE EXCEPTION
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |