Luky Library - 4.1.1 (20061117-1148)

luky.serverSimple
Class Client

java.lang.Object
  extended by luky.serverSimple.Client
Direct Known Subclasses:
ClientExtended

public class Client
extends Object

The Client class is a template class for the luky server client thread. use this class to setup, communicat and close server communications. The Client uses the Log class for it's loggings

the class is threadsafe since rev. 2

Version:
2.00
Author:
Chris Lukassen
 

Field Summary
protected  boolean connected
           
protected  BufferedReader reader
          variables
protected  PrintWriter writer
           
 
Constructor Summary
Client(String ip, int portNr)
          constructor, takes ip number and portnumber of the server to connect to
Client(String ip, String port)
           
 
Method Summary
 String getLine(String command)
          sends a command and expects one line terminated with OK. on return
 Vector getList(String command)
          sends a command and expects a list of lines terminated with OK. on return
 int openConnection()
           
 int sendCommand(String command)
          sends a command and expects OK. on return
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reader

protected BufferedReader reader
variables


writer

protected PrintWriter writer

connected

protected boolean connected
Constructor Detail

Client

public Client(String ip,
              int portNr)
constructor, takes ip number and portnumber of the server to connect to


Client

public Client(String ip,
              String port)
Method Detail

openConnection

public int openConnection()

sendCommand

public int sendCommand(String command)
sends a command and expects OK. on return


getLine

public String getLine(String command)
sends a command and expects one line terminated with OK. on return


getList

public Vector getList(String command)
sends a command and expects a list of lines terminated with OK. on return


Luky Library - 4.1.1 (20061117-1148)