|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface NetworkListener
Represents a listener to pastry network activity. This interface will notify you of opening/closing sockets, and all network traffic.
You hear about opening/closing sockets viachannelOpened()/channelClosed() methods.
You hear about network input via dataReceived() and network output via
dataSent().
channelOpened() has a reason for opening the chanel. The reason falls under
matrix of reasons:
dataSent()/dataReceived() methods include a wireType. These tell you if the
data was TCP/UDP and wether it was part of the SourceRoute
| Field Summary | |
|---|---|
static int |
REASON_ACC_BOOTSTRAP
Remote node opened a to acquire bootstrap information. |
static int |
REASON_ACC_NORMAL
Remote node opened a socket for normal FreePastry traffic. |
static int |
REASON_ACC_SR
Remote node opened a socket for source routing. |
static int |
REASON_APP_SOCKET_NORMAL
Local node opened an application level socket. |
static int |
REASON_BOOTSTRAP
Local node opened a to acquire bootstrap information. |
static int |
REASON_NORMAL
Local node opened a socket for normal FreePastry traffic. |
static int |
REASON_SR
Local node opened a socket for source routing. |
static int |
TYPE_SR_TCP
TCP traffic source-routed (you are an intermediate hop, not the source nor destination) |
static int |
TYPE_SR_UDP
UDP traffic source-routed (you are an intermediate hop, not the source nor destination) |
static int |
TYPE_TCP
TCP traffic (not source-routed) |
static int |
TYPE_UDP
UDP traffic (not source-routed) |
| Method Summary | |
|---|---|
void |
channelClosed(java.net.InetSocketAddress addr)
Called when a socket is closed. |
void |
channelOpened(java.net.InetSocketAddress addr,
int reason)
Called when a socket is opened. |
void |
dataReceived(int msgAddress,
short msgType,
java.net.InetSocketAddress socketAddress,
int size,
int wireType)
called when data is received. |
void |
dataSent(int msgAddress,
short msgType,
java.net.InetSocketAddress socketAddress,
int size,
int wireType)
called when data is sent. |
| Field Detail |
|---|
static final int TYPE_TCP
static final int TYPE_UDP
static final int TYPE_SR_TCP
static final int TYPE_SR_UDP
static final int REASON_NORMAL
static final int REASON_SR
static final int REASON_BOOTSTRAP
static final int REASON_ACC_NORMAL
static final int REASON_ACC_SR
static final int REASON_ACC_BOOTSTRAP
static final int REASON_APP_SOCKET_NORMAL
| Method Detail |
|---|
void channelOpened(java.net.InetSocketAddress addr,
int reason)
addr - the address the socket was opened toreason - see abovevoid channelClosed(java.net.InetSocketAddress addr)
addr - the address the socket was opened to
void dataSent(int msgAddress,
short msgType,
java.net.InetSocketAddress socketAddress,
int size,
int wireType)
msgAddress - the application the message belongs tomsgType - the type of message for that applicationsocketAddress - the socket it is fromsize - the size of the messagewireType - UDP/TCP
void dataReceived(int msgAddress,
short msgType,
java.net.InetSocketAddress socketAddress,
int size,
int wireType)
msgAddress - the application the message belongs tomsgType - the type of message for that applicationsocketAddress - the socket it is fromsize - the size of the messagewireType - UDP/TCP
|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||