cz.cuni.pogamut.Parser
Class RemoteParserServer
java.lang.Object
cz.cuni.pogamut.Parser.RemoteParserServer
- All Implemented Interfaces:
- java.lang.Runnable
public class RemoteParserServer
- extends java.lang.Object
- implements java.lang.Runnable
This class is instantiated by RemoteParser to listen on a specific port and accepting
client connections.
Constructor Summary |
RemoteParserServer(int port,
java.net.URI gbUri,
java.util.logging.Logger log)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_IO_EXCEPTIONS_SEQUENCE
public static final int MAX_IO_EXCEPTIONS_SEQUENCE
- See Also:
- Constant Field Values
threadAlive
private Flag<java.lang.Boolean> threadAlive
- Flag which tells us wether threadIsAlive - initialize the flag at the beggining
of the run() and drops it as the last command of the run().
We assume that you may have only one thread running with one instance of the class.
socket
private java.net.ServerSocket socket
gbUri
private java.net.URI gbUri
log
private java.util.logging.Logger log
clientLog
private java.util.logging.Logger clientLog
idMap
private UnrealIDMap idMap
exception
private int exception
runningClients
private java.util.ArrayList<RemoteParserServer.MediatorStorage> runningClients
terminating
private boolean terminating
RemoteParserServer
public RemoteParserServer(int port,
java.net.URI gbUri,
java.util.logging.Logger log)
throws java.io.IOException
- Throws:
java.io.IOException
initClientLog
private void initClientLog()
stopEverything
private void stopEverything()
initNewClient
private void initNewClient(java.net.Socket clientSocket)
throws ConnectException,
java.io.IOException
- Init new mediator / parser for a client identified by the socket.
Exceptions:
UnknownHostException -> can't resolve GameBots address
ConnectException -> can't connect to GameBots
IOException -> communication error
- Parameters:
clientSocket
-
- Throws:
ConnectException
java.io.IOException
exceptionReachedLimit
private boolean exceptionReachedLimit()
run
public void run()
- Specified by:
run
in interface java.lang.Runnable