monrovia.client.protocol
Class UdpReceiver

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--monrovia.client.protocol.UdpReceiver
All Implemented Interfaces:
java.lang.Runnable

public class UdpReceiver
extends java.lang.Thread

UdpReceiver is the thread listening for udp messages from the server


Field Summary
 boolean mConnectionOpen
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
UdpReceiver(ClientProtocolHandler pProtocolHandler)
          Constructor
UdpReceiver(javax.microedition.io.DatagramConnection pDatagramConnection, ClientProtocolHandler pProtocolHandler)
          Constructor
 
Method Summary
 void run()
          the listener implementation
 int setData(byte[] pBytes)
          setData is the tcp side implementation of the monrovia protocol
 
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

UdpReceiver

public UdpReceiver(javax.microedition.io.DatagramConnection pDatagramConnection,
                   ClientProtocolHandler pProtocolHandler)
Constructor
Parameters:
pDatagramConnection - the udpsocket/"connection"
pProtocolHandler - the handler for the recieved udp messages

UdpReceiver

public UdpReceiver(ClientProtocolHandler pProtocolHandler)
Constructor
Parameters:
pProtocolHandler - the handler for the recieved messages
Method Detail

run

public void run()
the listener implementation
Overrides:
run in class java.lang.Thread

setData

public int setData(byte[] pBytes)
setData is the tcp side implementation of the monrovia protocol
Parameters:
pBytes - the bytes of the packet to interpret
Returns:
0 if the packet contained no control signals, otherwise tcp opcodes