|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.pogamut.Parser.ParserConnection
public class ParserConnection
Wrapper for the socket to the Remote Parser. User by Client when the Remote Parser is requested.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_ADDRESS
Default address for connection ... localhost |
static int |
DEFAULT_PORT
Default port for connection ... localhost |
protected java.io.ObjectInputStream |
input
|
private java.util.logging.Logger |
log
|
private java.io.PrintWriter |
output
|
protected java.net.InetAddress |
serverAddress
InetAddress used by the connection (remote side) |
protected int |
serverPort
Remote port of the connection. |
private java.net.Socket |
socket
|
Constructor Summary | |
---|---|
ParserConnection()
Inicialize class. |
|
ParserConnection(java.lang.String netAddress)
Inicialize class. |
|
ParserConnection(java.lang.String netAddress,
int port,
java.util.logging.Logger log)
Inicialize class. |
Method Summary | |
---|---|
void |
close()
|
void |
connect()
Connect to Unreal Server with installed GameBot using parametr from constructor. |
(package private) void |
disconnect()
Clean up stuff. |
boolean |
isConnected()
Is class connected to RemoteParser? |
MessageObject |
readObject()
|
void |
send(java.lang.String msg)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_ADDRESS
public static final int DEFAULT_PORT
protected java.net.InetAddress serverAddress
protected int serverPort
private java.net.Socket socket
protected java.io.ObjectInputStream input
private java.io.PrintWriter output
private java.util.logging.Logger log
Constructor Detail |
---|
public ParserConnection(java.lang.String netAddress, int port, java.util.logging.Logger log) throws java.net.UnknownHostException
netAddress
- network address, where is running the RemoteParserport
- port, where RemoteParser listens
java.net.UnknownHostException
- if passed hostname/ip address doesnt exists, throw exceptionpublic ParserConnection(java.lang.String netAddress) throws java.net.UnknownHostException
netAddress
- network address, where is running UT2004 server with GameBots
java.net.UnknownHostException
- if passed hostname/ip address doesnt exists, throw exceptionpublic ParserConnection() throws java.net.UnknownHostException
java.net.UnknownHostException
- if passed hostname/ip address doesnt exists, throw exceptionMethod Detail |
---|
public void connect() throws ConnectException
ConnectException
If
- socket can't be created, throw IOExceptionvoid disconnect() throws DisconnectException
DisconnectException
public boolean isConnected()
public void send(java.lang.String msg) throws CantWriteException
CantWriteException
public MessageObject readObject() throws CantReadException
CantReadException
public void close() throws CantCloseConnectionException
CantCloseConnectionException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |