gecco.communication.client
Class ServerConnection

java.lang.Object
  |
  +--gecco.communication.client.ServerConnection

public class ServerConnection
extends Object

This class keeps track of the connection to the server

Author:
Niklas Hallenfur, Jon Åslund

Field Summary
private  DataInputStream data_in
          Description of the Field
private  DataOutputStream data_out
          Description of the Field
private  BufferedInputStream in
          Description of the Field
private  BufferedReader inString
          Description of the Field
private  BufferedOutputStream out
          Description of the Field
private  Socket s
          Description of the Field
 
Constructor Summary
ServerConnection()
          Constructor for the ServerConnection object
 
Method Summary
 void connectToServer(String hostname, int port)
          Tries to connect to a server
 DataInputStream getDataInputStream()
          Gets the DataInputStream attribute of the ServerConnection object
 DataOutputStream getDataOutputStream()
          Gets the DataOutputStream attribute of the ServerConnection 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

inString

private BufferedReader inString
Description of the Field

data_in

private DataInputStream data_in
Description of the Field

data_out

private DataOutputStream data_out
Description of the Field
Constructor Detail

ServerConnection

public ServerConnection()
Constructor for the ServerConnection object
Method Detail

getDataOutputStream

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

getDataInputStream

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

connectToServer

public void connectToServer(String hostname,
                            int port)
                     throws Exception
Tries to connect to a server
Parameters:
port - the port to connect to
hostname - Description of Parameter
Throws:
Exception - Description of Exception