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.
-
leftCount
- Left flip count.
-
rightCount
- Right flip count.
-
server
- The server that receives the data.
-
startTime
- Start Time.
-
strategy
- The strategy who plays the game.
-
stub
- The stub to control.
-
NetworkListener(MyServer, Stub)
- Setup the network listener.
-
getHeaderInfo(StringTokenizer)
- Get the header info.
-
getLogInfo(StringTokenizer)
- Get the log info.
-
listening()
- Keep listening for commands and follow them out.
-
ping(long)
- Respond to ping with pong.
-
processCommand(String)
- Process the command from the network.
-
run()
- Listen for commands and follow them out.
-
toString()
- Name of the object.
server
protected MyServer server
- The server that receives the data.
stub
protected Stub stub
- The stub to control.
strategy
protected Strategy strategy
- The strategy who plays the game.
leftCount
protected int leftCount
- Left flip count.
rightCount
protected int rightCount
- Right flip count.
startTime
protected long startTime
- Start Time.
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.
toString
public String toString()
- Name of the object.
- Overrides:
- toString in class Thread
run
public void run()
- Listen for commands and follow them out.
- Overrides:
- run in class Thread
listening
public void listening()
- Keep listening for commands and follow them out.
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.
ping
public void ping(long time)
- Respond to ping with pong.
- Parameters:
- time - the time of the ping.
getLogInfo
public void getLogInfo(StringTokenizer tokens)
- Get the log info.
- Parameters:
- tokens - the data from the command.
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