jfreerails.network
Class InetConnectionAccepter

java.lang.Object
  extended by jfreerails.network.InetConnectionAccepter
All Implemented Interfaces:
java.lang.Runnable

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

When this class is run in a thread it accepts new connections to its Server Socket and adds them to the NewGameServer that was passed to its constructor.

Author:
Luke

Field Summary
private  GameServer gameServer
           
private  SynchronizedFlag keepRunning
           
private static java.util.logging.Logger logger
           
private  java.net.ServerSocket serverSocket
           
 
Constructor Summary
InetConnectionAccepter(int port, GameServer gameServer)
           
 
Method Summary
 int getLocalPort()
           
private  boolean isKeepRunning()
           
static void main(java.lang.String[] args)
           
 void run()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final java.util.logging.Logger logger

gameServer

private final GameServer gameServer

keepRunning

private final SynchronizedFlag keepRunning

serverSocket

private final java.net.ServerSocket serverSocket
Constructor Detail

InetConnectionAccepter

public InetConnectionAccepter(int port,
                              GameServer gameServer)
                       throws java.io.IOException
Throws:
java.io.IOException
Method Detail

main

public static void main(java.lang.String[] args)

run

public void run()
Specified by:
run in interface java.lang.Runnable

stop

public void stop()
          throws java.io.IOException
Throws:
java.io.IOException

isKeepRunning

private boolean isKeepRunning()

getLocalPort

public int getLocalPort()