universe.server
Class UniverseServerSocket

java.lang.Object
  |
  +--universe.server.UniverseServerSocket

class UniverseServerSocket
extends java.lang.Object

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.

Version:
$Id: UniverseServerSocket.java,v 1.4 2001/11/04 21:11:57 jjweston Exp $
Author:
Sean Starkey

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

listening

private boolean listening

done

private boolean done

ready

private boolean ready

port

private int port
Constructor Detail

UniverseServerSocket

public UniverseServerSocket(int port)
Prepares this class for listening to connections by receiving the port number to accept connections on.

Parameters:
port - the port to listen for connections on
Method Detail

startListening

public void startListening()
Creates a ServerSocket and starts listening for connections on the specified port. This call will not return until the stopListening method is called on this class.


ready

private void ready()

isReady

public boolean isReady()
Determines if we are ready to accept connections.

Returns:
true if we are, false otherwise

isListening

private boolean isListening()

stopListening

public void stopListening()
Tells this class to stop listening for connections. The thread that is listening for connections will shutdown and exit.


isDone

public boolean isDone()
Determine if the thread in this class has completed execution.

Returns:
true if the thread is done, false otherwise

done

private void done()


Copyright © 2001 Universe Dev Team All Rights Reserved.