ictk.boardgame.chess.net.ics.fics
Class FICSProtocolHandler
java.lang.Object
ictk.boardgame.chess.net.ics.ICSProtocolHandler
ictk.boardgame.chess.net.ics.fics.FICSProtocolHandler
- All Implemented Interfaces:
- java.lang.Runnable
- public class FICSProtocolHandler
- extends ICSProtocolHandler
Handles logging into the FICS server and splitting the server messages
into chunks. These chunks are then examined to see if they corrispond to
any of the known FICS events. The message is then sent to the
ICSEventRouter connected to this object so it can be dispatched to
an object that wishes to be notified of that event.
Field Summary |
static int |
SOCKET_TIMEOUT
the socket time-out is used to see if our connection is dropped
and we're not told about it. |
Methods inherited from class ictk.boardgame.chess.net.ics.ICSProtocolHandler |
addConnectionListener, dispatchConnectionEvent, getEventRouter, getHandle, getHost, getPassword, getPort, isConnected, isLagCompensated, isLoggedIn, removeConnectionListener, setEventRouter, setHandle, setHost, setLagCompensation, setPassword, setPort |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SOCKET_TIMEOUT
public static final int SOCKET_TIMEOUT
- the socket time-out is used to see if our connection is dropped
and we're not told about it. The number is in milliseconds
- See Also:
- Constant Field Values
FICSProtocolHandler
public FICSProtocolHandler()
FICSProtocolHandler
public FICSProtocolHandler(java.lang.String host,
int port)
connect
public void connect()
throws java.net.UnknownHostException,
java.io.IOException
- Specified by:
connect
in class ICSProtocolHandler
- Throws:
java.net.UnknownHostException
java.io.IOException
run
public void run()
disconnect
public void disconnect()
- Specified by:
disconnect
in class ICSProtocolHandler
sendCommand
public void sendCommand(java.lang.String cmd,
boolean echo)
- send a command to the server.
- Specified by:
sendCommand
in class ICSProtocolHandler
sendCommand
public void sendCommand(java.lang.String cmd)
- Specified by:
sendCommand
in class ICSProtocolHandler