All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class connection.socket.Client

java.lang.Object
   |
   +----connection.socket.Client

public abstract class Client
extends Object
Client that connects to the Server using a socket over which it sends Messages.

Version:
0.30, 1998/04/01
Author:
FRED development team, Antti Viljamaa, Jukka Viljamaa
See Also:
Server, Message

Variable Index

 o connectionManager
The connection manager.
 o DEFAULT_PORT
The default port of the server.
 o host
The host name of the server.
 o port
The port of the server.
 o socket
The socket and streams connected to it.

Constructor Index

 o Client(String[])
Constructs a new Client and processes command line arguments.

Method Index

 o connect()
Connects to the server.
 o createMessageHandlers(ConnectionManager, MessageHandler)
Creates the message handlers for the client.
 o disconnect()
Disconnects from the server.
 o getConnectionManager()
Gets the connection manager.
 o getHost()
Gets the host name of the server.
 o processCommandLine(String[])
Processes the command line arguments of the client.
 o setConnectionManager(ConnectionManager)
Sets the connection manager.
 o setHost(String)
Sets the host name of the server.
 o setStatus(String)
Sets the status string of the client.
 o usage()
Prints usage information.

Variables

 o connectionManager
 private ConnectionManager connectionManager
The connection manager.

 o DEFAULT_PORT
 public static final int DEFAULT_PORT
The default port of the server.

 o port
 private static int port
The port of the server.

 o host
 private static String host
The host name of the server.

 o socket
 private Socket socket
The socket and streams connected to it.

Constructors

 o Client
 public Client(String args[])
Constructs a new Client and processes command line arguments.

Parameters:
args - The command line arguments. Usage: java Client [[hostname] port].
args - Command line arguments.

Methods

 o setStatus
 public abstract void setStatus(String txt)
Sets the status string of the client.

 o createMessageHandlers
 public abstract MessageHandler createMessageHandlers(ConnectionManager connectionManager,
                                                      MessageHandler rootHandler)
Creates the message handlers for the client.

 o processCommandLine
 protected void processCommandLine(String args[])
Processes the command line arguments of the client.

Parameters:
args - The command line arguments. "Usage: java Client [[hostname] port]"
 o usage
 protected void usage()
Prints usage information.

 o connect
 public void connect()
Connects to the server.

 o disconnect
 public void disconnect()
Disconnects from the server.

 o getHost
 public static String getHost()
Gets the host name of the server.

 o setHost
 public static void setHost(String s)
Sets the host name of the server.

 o getConnectionManager
 public ConnectionManager getConnectionManager()
Gets the connection manager.

 o setConnectionManager
 public void setConnectionManager(ConnectionManager ml)
Sets the connection manager.


All Packages  Class Hierarchy  This Package  Previous  Next  Index