|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.neem.impl.Transport
public class Transport
Implementation of the network layer.
Field Summary | |
---|---|
int |
accepted
|
int |
bytesIn
|
int |
bytesOut
|
int |
connected
|
int |
pktIn
|
int |
pktOut
|
Constructor Summary | |
---|---|
Transport(java.util.Random rand,
java.net.InetSocketAddress local)
|
Method Summary | |
---|---|
void |
add(java.net.InetSocketAddress addr)
Initiate connection to peer. |
void |
close()
Close all socket connections and release polling thread. |
Connection[] |
connections()
Get all connections. |
void |
gc()
Call periodically to garbage collect idle connections. |
int |
getBufferSize()
|
java.net.InetSocketAddress |
getLocalSocketAddress()
Get local address. |
java.net.InetSocketAddress[] |
getPeers()
Get addresses of all connected peers. |
int |
getQueueSize()
|
void |
queue(java.lang.Runnable task)
Queue processing task. |
void |
resetCounters()
|
void |
run()
Main loop. |
void |
schedule(java.lang.Runnable task,
long delay)
Schedule processing task. |
void |
setBufferSize(int bufferSize)
|
void |
setConnectionListener(ConnectionListener handler)
Sets the reference to the connection handler. |
void |
setDataListener(DataListener handler,
short port)
Add a reference to a message handler. |
void |
setQueueSize(int queueSize)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int accepted
public int connected
public int pktOut
public int pktIn
public int bytesOut
public int bytesIn
Constructor Detail |
---|
public Transport(java.util.Random rand, java.net.InetSocketAddress local) throws java.io.IOException, java.net.BindException
java.io.IOException
java.net.BindException
Method Detail |
---|
public java.net.InetSocketAddress getLocalSocketAddress()
public Connection[] connections()
public java.net.InetSocketAddress[] getPeers()
public void gc()
public void close()
public void queue(java.lang.Runnable task)
public void schedule(java.lang.Runnable task, long delay)
delay
- delay before executionpublic void add(java.net.InetSocketAddress addr)
public void setDataListener(DataListener handler, short port)
public void setConnectionListener(ConnectionListener handler)
public void run()
run
in interface java.lang.Runnable
public int getQueueSize()
public void setQueueSize(int queueSize)
public int getBufferSize()
public void setBufferSize(int bufferSize)
public void resetCounters()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |