ks.common.network
Class SimpleClientConnection

java.lang.Object
  extended byks.common.network.SimpleClientConnection

public class SimpleClientConnection
extends java.lang.Object

Base class to manage the client-side of a Socket connection.


Constructor Summary
SimpleClientConnection(java.lang.String theHost, int thePort)
          Prepare connection on given host and port.
 
Method Summary
 void disconnect()
          Terminate the connection to the server.
 CommunicationAgent getAgent()
          Return agent responsible for communication to server.
 boolean isConnected()
          Determines if server is open for communication?
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleClientConnection

public SimpleClientConnection(java.lang.String theHost,
                              int thePort)
                       throws java.io.IOException
Prepare connection on given host and port.

Parameters:
theHost - host to which connection is requested.
thePort - Socket port number to which to connect.
Throws:
java.io.IOException - Any failure is reported as an exception.
Method Detail

disconnect

public void disconnect()
Terminate the connection to the server.


isConnected

public boolean isConnected()
Determines if server is open for communication?

Returns:
true if server is available for communication; false otherwise.

getAgent

public CommunicationAgent getAgent()
Return agent responsible for communication to server.

Returns:
agent responsible for communication.