transport
Class SocketReceiver

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--transport.SocketReceiver
All Implemented Interfaces:
java.lang.Runnable

public class SocketReceiver
extends java.lang.Thread

This class is used by the controller to receive Messages sent by ipaq clients. This class mearly passes the messages up to the Controller, it to deal with.


Field Summary
private  transport.SocketReceiverListener controller
          The SocketReceiverListener object to pass messages to.
private  int port
          The port to listen on.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SocketReceiver(transport.SocketReceiverListener controller, int port)
          This constructor initializes the Receiver, so that it is ready to begin listening for messages.
 
Method Summary
 void run()
          This method opens a Socket and listens to it forever.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

port

private int port
The port to listen on.


controller

private transport.SocketReceiverListener controller
The SocketReceiverListener object to pass messages to.

Constructor Detail

SocketReceiver

public SocketReceiver(transport.SocketReceiverListener controller,
                      int port)
This constructor initializes the Receiver, so that it is ready to begin listening for messages.

Parameters:
controller - The listener to notify.
port - The port this receiver is listening on.
Method Detail

run

public void run()
This method opens a Socket and listens to it forever. When it gets an incoming message it will pass it up to the Listener, and then continue to listen.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread