|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeer2me.network.NodeConnection
This class contains a thread that runs on each connected node and listens for incoming data packages and sends data packages out. It is created and started in NodeConnection.startNodeConnection().
Constructor Summary | |
NodeConnection(javax.microedition.io.StreamConnection connection,
Node node)
Constructor. |
Method Summary | |
void |
closeConnection()
This method closes the input- and output streams and the connection. |
javax.microedition.io.StreamConnection |
getConnection()
This method returns the connection object. |
int |
getSendQueueSize()
This method return the size of the sendQue. |
void |
openInputStream()
This method sets a boolean that controls whether or not the InputStream are allowed to listen for incoming data. |
void |
openOutputStream()
This method sets a boolean that controls whether or not the OutputStream are allowed to send data. |
void |
processIncomingData()
This method receives incoming datapackages from remote nodes. |
void |
processSendQueue()
This method sends datapackages to remote nodes. |
void |
sendDataPackage(DataPackage dataPackage)
This method is called by the sendMessage() method in the Network class when a data package is sent to the Node associated with this NodeConnection. |
void |
setConnection(javax.microedition.io.StreamConnection connection)
This method updates the connection object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NodeConnection(javax.microedition.io.StreamConnection connection, Node node)
connection
- The connection to the nodenode
- The node that owns this NodeConnectionMethod Detail |
public int getSendQueueSize()
public void processIncomingData()
public void processSendQueue()
public void sendDataPackage(DataPackage dataPackage)
dataPackage
- The DataPackage to sendpublic javax.microedition.io.StreamConnection getConnection()
public void setConnection(javax.microedition.io.StreamConnection connection)
connection
- The connection to the remote nodepublic void openInputStream()
public void openOutputStream()
public void closeConnection()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |