Internet Chess ToolKit
v0.2.0

ictk.boardgame.chess.net.ics.fics
Class FICSProtocolHandler

java.lang.Object
  extended byictk.boardgame.chess.net.ics.ICSProtocolHandler
      extended byictk.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.
 
Constructor Summary
FICSProtocolHandler()
           
FICSProtocolHandler(java.lang.String host, int port)
           
 
Method Summary
 void connect()
           
 void disconnect()
           
 void run()
           
 void sendCommand(java.lang.String cmd)
           
 void sendCommand(java.lang.String cmd, boolean echo)
          send a command to the server.
 
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
 

Field Detail

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
Constructor Detail

FICSProtocolHandler

public FICSProtocolHandler()

FICSProtocolHandler

public FICSProtocolHandler(java.lang.String host,
                           int port)
Method Detail

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

Submit a bug or feature
Visit the Website
Internet Chess ToolKit is licensed under the GPL v2 .