|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--universe.server.UniverseServerSocket
Creates a ServerSocket
and listens for connections on
the port specified in the constructor. This class takes the thread
that is used to call the constructor and uses it to listen for
connections.
Field Summary | |
private boolean |
done
|
private boolean |
listening
|
private int |
port
|
private boolean |
ready
|
Constructor Summary | |
UniverseServerSocket(int port)
Prepares this class for listening to connections by receiving the port number to accept connections on. |
Method Summary | |
private void |
done()
|
boolean |
isDone()
Determine if the thread in this class has completed execution. |
private boolean |
isListening()
|
boolean |
isReady()
Determines if we are ready to accept connections. |
private void |
ready()
|
void |
startListening()
Creates a ServerSocket and starts listening for
connections on the specified port. |
void |
stopListening()
Tells this class to stop listening for connections. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean listening
private boolean done
private boolean ready
private int port
Constructor Detail |
public UniverseServerSocket(int port)
port
- the port to listen for connections onMethod Detail |
public void startListening()
ServerSocket
and starts listening for
connections on the specified port. This call will not return
until the stopListening
method is called on this
class.
private void ready()
public boolean isReady()
private boolean isListening()
public void stopListening()
public boolean isDone()
private void done()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |