|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectx10.net.SocketController
SocketController is a Client-side virtual Controller object that connects to a ControllerServer via TCP socket.
| Constructor Summary | |
SocketController(java.lang.String host,
int port)
SocketController constructs a SocketController that automatically connects to the ControllerServer on the specified host and port. |
|
| Method Summary | |
void |
addCommand(Command command)
addCommand adds a Command to be queued and then dispatched to the ControllerServer |
void |
addUnitListener(UnitListener listener)
addUnitListener registers the specified UnitListener to recieve UnitEvents |
void |
removeUnitListener(UnitListener listener)
removeUnitListener unregisters the specified UnitListener. |
void |
run()
run loops receiving events from the ControllerServer and then dispatching the events to locally registered UnitListeners. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SocketController(java.lang.String host,
int port)
throws java.io.IOException,
java.net.SocketException
host - the hostname or IP address of the server that is hosting
the ControllerServer.port - the port that the ControllerServer is listening on.
java.io.IOException - thrown if an error occurs setting up the streams
to/from the ControllerServer
java.net.SocketException - thrown if an error occurs connecting to the
ControllerServer| Method Detail |
public void addUnitListener(UnitListener listener)
addUnitListener in interface Controllerlistener - the listener to registerUnitEventpublic void removeUnitListener(UnitListener listener)
removeUnitListener in interface Controllerlistener - the listener to remove.public void addCommand(Command command)
addCommand in interface Controllercommand - the Command to be queued.public void run()
run in interface java.lang.Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||