lime
Class ConnectionMgr.Connection

java.lang.Object
  extended bylime.ConnectionMgr.Connection
Enclosing class:
ConnectionMgr

class ConnectionMgr.Connection
extends java.lang.Object

Connection manages the TCP connection to a remote host.


Field Summary
(package private)  boolean dead
          Keeps track of whether this connection is still open.
(package private)  java.io.ObjectInputStream is
          The input stream from the socket.
(package private)  LimeServerID key
          The key that uniquely(?) identifies this connection.
(package private)  java.io.ObjectOutputStream os
          The output stream from the socket.
(package private)  java.net.Socket socket
          The TCP socket opened by this connection.
 
Constructor Summary
(package private) ConnectionMgr.Connection(LimeServerID l)
          Creates a connection to the specified LimeServer.
(package private) ConnectionMgr.Connection(java.net.Socket socket)
          Creates a connection for the given socket.
 
Method Summary
 void close()
          Closes the socket managed by this connection.
private  void setStreams()
          Initializes the input and output streams of this connection.
 java.lang.String toString()
          Returns a string representation of this connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

socket

java.net.Socket socket
The TCP socket opened by this connection.


is

java.io.ObjectInputStream is
The input stream from the socket.


os

java.io.ObjectOutputStream os
The output stream from the socket.


key

LimeServerID key
The key that uniquely(?) identifies this connection.


dead

boolean dead
Keeps track of whether this connection is still open.

Constructor Detail

ConnectionMgr.Connection

ConnectionMgr.Connection(java.net.Socket socket)
Creates a connection for the given socket.


ConnectionMgr.Connection

ConnectionMgr.Connection(LimeServerID l)
Creates a connection to the specified LimeServer.

Method Detail

close

public void close()
Closes the socket managed by this connection.


toString

public java.lang.String toString()
Returns a string representation of this connection.

Returns:
a string representation of this connection.

setStreams

private void setStreams()
Initializes the input and output streams of this connection. This is called by both of the constructors.