Class SessionBuilder
java.lang.Object
org.simpleframework.http.socket.service.SessionBuilder
The
SessionBuilder
object is used to create sessions
for connected WebSockets. Before the session is created a response
is sent back to the connected client. If for some reason the session
is not valid or does not conform to the requirements of RFC 6455
then a HTTP 400 response code is sent and the TCP channel is closed.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSessionBuilder
(Scheduler scheduler, Reactor reactor, long ping) Constructor for theSessionBuilder
object. -
Method Summary
-
Field Details
-
scheduler
This is the scheduler that is used to ping WebSocket sessions. -
reactor
This is the reactor used to register for I/O notifications. -
ping
private final long pingThis is the frequency the server should send out ping frames.
-
-
Constructor Details
-
SessionBuilder
Constructor for theSessionBuilder
object. This is used to create sessions using the request and response associated with the WebSocket opening handshake.- Parameters:
scheduler
- this is the shared thread pool used for pingingreactor
- this is used to check for I/O notificationsping
- this is the frequency to send out ping frames
-
-
Method Details
-
create
This is used to create a WebSocket session. If at any point there is an error creating the session the underlying TCP connection is closed and aSession
is returned regardless.- Parameters:
request
- this is the request associated with this sessionresponse
- this is the response associated with this session- Returns:
- this returns the session associated with the WebSocket
- Throws:
Exception
-