keepalive.socket.adapter
Class ServerSocketAdapter
java.lang.Object
|
+--keepalive.socket.adapter.ServerSocketAdapter
- All Implemented Interfaces:
- ServerSocketIfc
- public class ServerSocketAdapter
- extends java.lang.Object
- implements ServerSocketIfc
An adapter class that wraps a TCP/IP ServerSocket to allow it to be used
with our ServerSocket interface.
Constructor Summary |
ServerSocketAdapter(int port)
Create new ServerSocket adapter for a ServerSocket that will be
bound to the given port. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ServerSocketAdapter
public ServerSocketAdapter(int port)
throws java.io.IOException
- Create new ServerSocket adapter for a ServerSocket that will be
bound to the given port.
- Parameters:
port
- - Throws:
java.io.IOException
- if an I/O error occurs.
accept
public AbstractSocket accept()
throws java.io.IOException
- Accept a connection and spin off a new socket.
- Specified by:
accept
in interface ServerSocketIfc
- Returns:
- the spun-off socket.
- Throws:
java.io.IOException
-
close
public void close()
throws java.io.IOException
- Close this ServerSocket.
- Specified by:
close
in interface ServerSocketIfc
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object