network
Class Server

java.lang.Object
  extended bynetwork.Server
All Implemented Interfaces:
java.lang.Runnable

public class Server
extends java.lang.Object
implements java.lang.Runnable

Listens for connection requests.

Author:
hoele, cooperse

Constructor Summary
Server(Network network)
          Constructs a new Server for the given Network.
 
Method Summary
 void run()
          While the thread is running, listen for incoming connection requests on port Network.PORT and notifies the Network so it can create a connection.
 void start()
          Start the Server thread.
 void stop()
          Stop the Server thread.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Server

public Server(Network network)
       throws java.io.IOException
Constructs a new Server for the given Network.

Parameters:
network - A Network to notify about incoming connection requests.
Throws:
java.io.IOException - Probably can't listen on the given port.
Method Detail

start

public void start()
Start the Server thread.


stop

public void stop()
Stop the Server thread.


run

public void run()
While the thread is running, listen for incoming connection requests on port Network.PORT and notifies the Network so it can create a connection.

Specified by:
run in interface java.lang.Runnable