monrovia.protocol.server
Class ServerUdpReceiver
java.lang.Object
|
+--java.lang.Thread
|
+--monrovia.protocol.server.ServerUdpReceiver
- All Implemented Interfaces:
- java.lang.Runnable
- public class ServerUdpReceiver
- extends java.lang.Thread
ServerUdpReceiver is the servers thread for
receving udp messages from the clients
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary |
void |
run()
the listeners implementation |
int |
setData(byte[] pBytes,
int clientID)
sets data for tcp implementation of the monrovia protocol |
void |
startSending()
startSending allows the sender to send messages, if not called nothing
will happen |
Methods inherited from class java.lang.Thread |
activeCount, currentThread, getPriority, isAlive, join, setPriority, sleep, start, toString, yield |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
mConnectionOpen
public boolean mConnectionOpen
ServerUdpReceiver
public ServerUdpReceiver(java.net.DatagramSocket pDatagramSocket,
ProtocolHandler pProtocolHandler)
- Constructor
- Parameters:
pDatagramSocket
- a socket for listeningpProtocolHandler
- the servers protocolhandler
for passing the messages from the clients
ServerUdpReceiver
public ServerUdpReceiver(ProtocolHandler pProtocolHandler)
- Constructor
- Parameters:
pProtocolHandler
- the servers protocolhandler
for passing the messages from the clients
run
public void run()
- the listeners implementation
- Overrides:
run
in class java.lang.Thread
setData
public int setData(byte[] pBytes,
int clientID)
- sets data for tcp implementation of the monrovia protocol
- Parameters:
pBytes
- the bytes to readcliendID
- the id of the client whos data this is- Returns:
- result of read - 0 if ok, tcpopcodes if message contained
control signals
startSending
public void startSending()
- startSending allows the sender to send messages, if not called nothing
will happen