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


Field Summary
 boolean mConnectionOpen
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServerUdpReceiver(java.net.DatagramSocket pDatagramSocket, ProtocolHandler pProtocolHandler)
          Constructor
ServerUdpReceiver(ProtocolHandler pProtocolHandler)
          Constructor
 
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
 

Field Detail

mConnectionOpen

public boolean mConnectionOpen
Constructor Detail

ServerUdpReceiver

public ServerUdpReceiver(java.net.DatagramSocket pDatagramSocket,
                         ProtocolHandler pProtocolHandler)
Constructor
Parameters:
pDatagramSocket - a socket for listening
pProtocolHandler - 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
Method Detail

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 read
cliendID - 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