gecco.communication.server
Class ClientConnection

java.lang.Object
  |
  +--gecco.communication.server.ClientConnection

public class ClientConnection
extends Object

A class that keeps track of the 'physical' connection to a client

Author:
Niklas Hallenfur

Field Summary
private  DataInputStream data_in
          Description of the Field
private  DataOutputStream data_out
          Description of the Field
private  int id
          Description of the Field
private  BufferedInputStream in
          Description of the Field
private  BufferedOutputStream out
          Description of the Field
private  String role
          Description of the Field
private  Socket s
          Description of the Field
 
Constructor Summary
ClientConnection(Socket sock, String r, int n1)
           
 
Method Summary
 DataInputStream getDataInputStream()
          Gets the DataInputStream attribute of the ClientConnection object
 DataOutputStream getDataOutputStream()
          Gets the DataOutputStream attribute of the ClientConnection object
 int getId()
          Gets the Id attribute of the ClientConnection object
 String getRole()
          Gets the Role attribute of the ClientConnection object
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

s

private Socket s
Description of the Field

out

private BufferedOutputStream out
Description of the Field

in

private BufferedInputStream in
Description of the Field

data_in

private DataInputStream data_in
Description of the Field

data_out

private DataOutputStream data_out
Description of the Field

id

private int id
Description of the Field

role

private String role
Description of the Field
Constructor Detail

ClientConnection

public ClientConnection(Socket sock,
                        String r,
                        int n1)
                 throws IOException
Parameters:
sock - The client's socket
r - The client's role
n1 - the client's unique id
Throws:
IOException - Description of Exception
Method Detail

getId

public int getId()
Gets the Id attribute of the ClientConnection object
Returns:
The Id value

getRole

public String getRole()
Gets the Role attribute of the ClientConnection object
Returns:
The Role value

getDataOutputStream

public DataOutputStream getDataOutputStream()
Gets the DataOutputStream attribute of the ClientConnection object
Returns:
The DataOutputStream value

getDataInputStream

public DataInputStream getDataInputStream()
Gets the DataInputStream attribute of the ClientConnection object
Returns:
The DataInputStream value