net.sourceforge.yagurashogi.server
Class ShogiServer

java.lang.Object
  extended by java.lang.Thread
      extended by net.sourceforge.yagurashogi.server.ShogiServer
All Implemented Interfaces:
java.lang.Runnable

public class ShogiServer
extends java.lang.Thread

The main Shogi Server that manages multiple connections. It starts on port 4081 and awaits for clients.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 java.util.Hashtable<java.lang.String,Game> gamesByName
           
 java.util.Hashtable<java.lang.String,Player> playersByName
           
 java.util.Hashtable<java.lang.String,Player> playersBySocket
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ShogiServer()
          Creates new ShogiServer instance that will listen for incoming connections.
 
Method Summary
static void main(java.lang.String[] args)
          Starts the application.
 void run()
          Main loop.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

playersBySocket

public java.util.Hashtable<java.lang.String,Player> playersBySocket

playersByName

public java.util.Hashtable<java.lang.String,Player> playersByName

gamesByName

public java.util.Hashtable<java.lang.String,Game> gamesByName
Constructor Detail

ShogiServer

public ShogiServer()
            throws java.lang.Exception
Creates new ShogiServer instance that will listen for incoming connections. Also starts the GameMonitor and the PairingEngine.

Throws:
java.lang.Exception
Method Detail

run

public void run()
Main loop.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

main

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