org.pf.net
Class SocketConnection

java.lang.Object
  extended by org.pf.util.ExceptionIgnorer
      extended by org.pf.net.SocketConnection
Direct Known Subclasses:
BinarySocketConnection, TextSocketConnection

public class SocketConnection
extends ExceptionIgnorer

Generic superclass for connections on a specific socket (port).

Version:
1.0
Author:
Manfred Duchrow

Constructor Summary
SocketConnection(java.net.Socket openSocket)
          Initialize the new instance to work on the given socket.
SocketConnection(java.net.Socket openSocket, ExceptionHandler exHandler)
          Initialize the new instance to work on the given socket and use the specified exception handler to report exceptions to.
 
Method Summary
 void close()
          Close the connection and all release underlying resources.
 boolean isClosed()
          Returns true, if the connection is closed and can't be used anymore.
 boolean isOpen()
          Returns true, if the socket connection is open
 
Methods inherited from class org.pf.util.ExceptionIgnorer
exceptionOccurred, getExceptionHandler, setExceptionHandler
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketConnection

public SocketConnection(java.net.Socket openSocket)
Initialize the new instance to work on the given socket.


SocketConnection

public SocketConnection(java.net.Socket openSocket,
                        ExceptionHandler exHandler)
Initialize the new instance to work on the given socket and use the specified exception handler to report exceptions to.

Method Detail

isOpen

public boolean isOpen()
Returns true, if the socket connection is open


close

public void close()
Close the connection and all release underlying resources.


isClosed

public boolean isClosed()
Returns true, if the connection is closed and can't be used anymore.