|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object spellcast.server.ServerStatusRequestHandler
public class ServerStatusRequestHandler
The ServerStatusRequestHandler listens for ServerStatusRequest messages and
handles them. The class creates the datagram socket that is used
to receive the broadcast messages for ServerStatusRequests and creates
the ServerStatusResponse message. A new thread is started to handle the
message processing for ServerStatusRequestHandler when start
is called.
Call stop
to stop the thread.
Field Summary |
---|
Fields inherited from interface spellcast.net.NetConstants |
---|
SPELLCAST_NET_BROADCAST_INETADDRESS, SPELLCAST_NET_DEFAULT_PORT, SPELLCAST_NET_SERVERLIST_PORT |
Constructor Summary | |
---|---|
ServerStatusRequestHandler()
|
Method Summary | |
---|---|
void |
run()
This thread will start running when start is called and
continue running until the stop method is called. |
void |
start()
Allocate resources, create and start the thread. |
void |
stop()
Sets the isRunning flag to false which lets run exit the
infite loop. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServerStatusRequestHandler()
Method Detail |
---|
public void run()
start
is called and
continue running until the stop
method is called.
This method loops while checking for a ServerStatusRequest message to be
received. When it is received it queries the current game for its status
returns the status in a ServerStatusResponse message.
run
in interface java.lang.Runnable
public void start() throws ServerException
cleanup
.
ServerException
- thrown if the server status socket could not be allocated.public void stop()
run
exit the
infite loop. This method will wait until the thread dies before
calling cleanup
where resources are deallocated.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |