All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pinball.player.network.NetworkListener

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----pinball.player.network.NetworkListener

public class NetworkListener
extends Thread
Used to listen for commands from the client side. The remote stub sends these commands.


Variable Index

 o leftCount
Left flip count.
 o rightCount
Right flip count.
 o server
The server that receives the data.
 o startTime
Start Time.
 o strategy
The strategy who plays the game.
 o stub
The stub to control.

Constructor Index

 o NetworkListener(MyServer, Stub)
Setup the network listener.

Method Index

 o getHeaderInfo(StringTokenizer)
Get the header info.
 o getLogInfo(StringTokenizer)
Get the log info.
 o listening()
Keep listening for commands and follow them out.
 o ping(long)
Respond to ping with pong.
 o processCommand(String)
Process the command from the network.
 o run()
Listen for commands and follow them out.
 o toString()
Name of the object.

Variables

 o server
 protected MyServer server
The server that receives the data.

 o stub
 protected Stub stub
The stub to control.

 o strategy
 protected Strategy strategy
The strategy who plays the game.

 o leftCount
 protected int leftCount
Left flip count.

 o rightCount
 protected int rightCount
Right flip count.

 o startTime
 protected long startTime
Start Time.

Constructors

 o NetworkListener
 public NetworkListener(MyServer server,
                        Stub stub)
Setup the network listener. Get data from the client.

Parameters:
server - the server who gets the info.
stub - the stub to control the machine.

Methods

 o toString
 public String toString()
Name of the object.

Overrides:
toString in class Thread
 o run
 public void run()
Listen for commands and follow them out.

Overrides:
run in class Thread
 o listening
 public void listening()
Keep listening for commands and follow them out.

 o processCommand
 public boolean processCommand(String command)
Process the command from the network. Must return true or false to indicate if the command was processed.

Parameters:
command - the command from the network.
Returns:
the indication of weither the command was processed.
 o ping
 public void ping(long time)
Respond to ping with pong.

Parameters:
time - the time of the ping.
 o getLogInfo
 public void getLogInfo(StringTokenizer tokens)
Get the log info.

Parameters:
tokens - the data from the command.
 o getHeaderInfo
 public void getHeaderInfo(StringTokenizer tokens)
Get the header info.

Parameters:
tokens - the data from the command.

All Packages  Class Hierarchy  This Package  Previous  Next  Index