|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simpleframework.transport.connect.SocketConnection
public class SocketConnection
The SocketConnection
is used to manage connections
from a server socket. In order to achieve this it spawns a task
to listen for incoming connect requests. When a TCP connection
request arrives it hands off the SocketChannel
to
the Server
which processes the request.
This handles connections from a ServerSocketChannel
object so that features such as SSL can be used by a server that
uses this package. The background acceptor process will terminate
if the connection is closed.
Server
Constructor Summary | |
---|---|
SocketConnection(Container container)
Constructor for the SocketConnection object. |
|
SocketConnection(Server server)
Constructor for the SocketConnection object. |
Method Summary | |
---|---|
void |
close()
This is used to close the connection and the server socket used to accept connections. |
java.net.SocketAddress |
connect(java.net.SocketAddress address)
This creates a new background task that will listen to the specified ServerAddress for incoming TCP connect
requests. |
java.net.SocketAddress |
connect(java.net.SocketAddress address,
javax.net.ssl.SSLContext context)
This creates a new background task that will listen to the specified ServerAddress for incoming TCP connect
requests. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SocketConnection(Server server) throws java.io.IOException
SocketConnection
object. This
will create a new connection that accepts incoming connections
and hands these connections as Pipeline
objects
to the specified processor. This in turn will deliver request
and response objects to the internal container.
server
- this is the processor that receives requests
java.io.IOException
public SocketConnection(Container container) throws java.io.IOException
SocketConnection
object. This
will create a new connection that accepts incoming connections
and hands these connections as Pipeline
objects
to the specified processor. This in turn will deliver request
and response objects to the internal container.
container
- this is the container that receives requests
java.io.IOException
Method Detail |
---|
public java.net.SocketAddress connect(java.net.SocketAddress address) throws java.io.IOException
ServerAddress
for incoming TCP connect
requests. When an connection is accepted it is handed to the
internal Server
implementation as a pipeline. The
background task is a non daemon task to ensure the server is
kept active, to terminate the connection this can be closed.
connect
in interface Connection
address
- this is the address used to accept connections
java.io.IOException
public java.net.SocketAddress connect(java.net.SocketAddress address, javax.net.ssl.SSLContext context) throws java.io.IOException
ServerAddress
for incoming TCP connect
requests. When an connection is accepted it is handed to the
internal Server
implementation as a pipeline. The
background task is a non daemon task to ensure the server is
kept active, to terminate the connection this can be closed.
connect
in interface Connection
address
- this is the address used to accept connectionscontext
- this is used for secure SSL connections
java.io.IOException
public void close() throws java.io.IOException
connect
method. The connection can be
reused after the existing server sockets have been closed.
close
in interface java.io.Closeable
java.io.IOException
- thrown if there is a problem closing
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |