Package org.simpleframework.transport
Interface Socket
- All Known Subinterfaces:
Transport
- All Known Implementing Classes:
SecureTransport
,SocketTransport
,SocketWrapper
public interface Socket
This is a
Socket
interface that is used to represent
a socket. This has a map that allows attributes to be associated
with the client connection. Attributes such as security details
or other transport related details can be exposed by placing them
in the socket map. The Processor
can then use these
attributes as required.
This provides the connected SocketChannel
that can
be used to read and write data asynchronously. The socket channel
must be selectable and in non-blocking mode. If the socket is not
in a non-blocking state the connection will not be processed.
-
Method Summary
Modifier and TypeMethodDescriptionThis method is used to get theMap
of attributes for this socket.This method is used to acquire theSocketChannel
for the connection.This is used to acquire the SSL engine used for security.getTrace()
This is used to acquire the trace object that is associated with the socket.
-
Method Details
-
getTrace
Trace getTrace()This is used to acquire the trace object that is associated with the socket. A trace object is used to collection details on what operations are being performed on the socket. For instance it may contain information relating to I/O events or more application specific events such as errors.- Returns:
- this returns the trace associated with this socket
-
getEngine
SSLEngine getEngine()This is used to acquire the SSL engine used for security. If the socket is connected to an SSL transport this returns an SSL engine which can be used to establish the secure connection and send and receive content over that connection. If this is null then the socket represents a normal transport.- Returns:
- the SSL engine used to establish a secure transport
-
getChannel
SocketChannel getChannel()This method is used to acquire theSocketChannel
for the connection. This allows the server to acquire the input and output streams with which to communicate. It can also be used to configure the connection and perform various network operations that could otherwise not be performed.- Returns:
- this returns the socket used by this socket
-
getAttributes
Map getAttributes()This method is used to get theMap
of attributes for this socket. The attributes map is used to maintain details about the connection. Information such as security credentials to client details can be placed within the attribute map.- Returns:
- this returns the map of attributes for this socket
-