de.cau.cs.kieler.krep.evalbench.comm
Class SocketConnection

java.lang.Object
  extended by de.cau.cs.kieler.krep.evalbench.comm.Connection
      extended by de.cau.cs.kieler.krep.evalbench.comm.SocketConnection
All Implemented Interfaces:
IConnection

public class SocketConnection
extends Connection

Connection that uses sockets from java.net.

Rating yellow
(2010-02-05) review by cmot, msp

Constructor Summary
SocketConnection(String device, int port)
          Initializes connection.
 
Method Summary
 void dispose()
          Closes connection and removes locks on the involved device.
protected  InputStreamReader getInput()
          Retrieves the input stream for this connection.
protected  OutputStream getOutput()
          Retrieves the output stream for this connection.
 
Methods inherited from class de.cau.cs.kieler.krep.evalbench.comm.Connection
hark, receive, receive, receiveByte, send, send, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketConnection

public SocketConnection(String device,
                        int port)
                 throws CommunicationException
Initializes connection.

Parameters:
device - serial port name
port - port number
Throws:
CommunicationException - when an error occurred during initialization
Method Detail

dispose

public void dispose()
Closes connection and removes locks on the involved device.


getInput

protected InputStreamReader getInput()
Retrieves the input stream for this connection.

Specified by:
getInput in class Connection
Returns:
the input stream, or null if no input stream is available

getOutput

protected OutputStream getOutput()
Description copied from class: Connection
Retrieves the output stream for this connection.

Specified by:
getOutput in class Connection
Returns:
the output stream, or null if no output stream is available