simple.http.connect
Class Connection
java.lang.Object
simple.http.connect.Connection
public class Connection
- extends java.lang.Object
The Connection
manages connections from
ServerSocket
's. This class is used to dispatch
HTTP requests from Sockets
connected to a specific
port. The requests are processed by a handler which hands a
Pipeline
to a PipelineHandler
.
This handles connections from ServerSocket
objects so that features such as SSL can be used by a server
that uses this package. This will terminate the connection
once the ServerSocket
is closed, or once there
is an I/O problem accepting new connections.
- Author:
- Niall Gallagher
Constructor Summary |
Connection(SocketHandler handler)
Constructor for the Connection object
is used to create an instance that delegates all TCP
connections to the issued SocketHandler . |
Method Summary |
void |
connect(java.net.ServerSocket sock)
This will establish a thread that will listen for
connections using the issued ServerSocket . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Connection
public Connection(SocketHandler handler)
- Constructor for the
Connection
object
is used to create an instance that delegates all TCP
connections to the issued SocketHandler
.
- Parameters:
handler
- this is the handler that is used to
process HTTP requests from accepted sockets
connect
public void connect(java.net.ServerSocket sock)
- This will establish a thread that will listen for
connections using the issued
ServerSocket
.
Once this method has been invoked HTTP requests can
be made to the server socket port. If requests from
this port are no longer desired the close
method of the ServerSocket
can be used.
- Parameters:
sock
- this is the ServerSocket
that will listen for incoming TCP connections