gecco.communication.client
Class ServerConnection

java.lang.Object
  extended bygecco.communication.client.ServerConnection

public class ServerConnection
extends Object

This class keeps track of the connection to the server

Author:
Niklas Hallenfur, Jon Åslund

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, toString, wait, wait, wait
 

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