com.prolixtech.jaminid

Class Connection


public class Connection
extends Thread

The connection is a thread-of-service spanwed by the Daemon. The connection handles the IO part of the Response/Oracle/Request paradigm by creating the request and response objects, and calling the Oracle at the appropriate time to extract the output which will be send to the client.

Constructor Summary

Connection(Socket activeSocket, Daemon masterDaemon)
default constructor to create a Connection

Method Summary

static String
getGMTString(Date d)
String
getIPAddressString()
void
run()
The thread runs here.
protected void
sendString(Object string)
Sends a string to the client
protected void
sendString(byte[] bytes)

Constructor Details

Connection

public Connection(Socket activeSocket,
                  Daemon masterDaemon)
            throws IOException
default constructor to create a Connection
Parameters:
activeSocket - the socket on which the connection was madee
masterDaemon - the daemon that spanwed this connection

Method Details

getGMTString

public static String getGMTString(Date d)

getIPAddressString

public String getIPAddressString()

run

public void run()
The thread runs here. This essentially allows the Daemon to serve multiple threads. ALL IO is carried out here.

sendString

protected void sendString(Object string)
            throws IOException
Sends a string to the client
Parameters:
string -

sendString

protected void sendString(byte[] bytes)