#include <Pt/Http/WebSocketService.h>
WebSocket service for one session type.
Inherits WebSocketService.
|
|
| BasicWebSocketService () |
| | Default constructor.
|
|
| ~BasicWebSocketService () |
| | Destructor.
|
| std::size_t | maxSockets () const |
| | Returns the maximum number of live sessions.
|
| void | setMaxSockets (std::size_t n) |
| | Sets the maximum number of live sessions.
|
|
std::size_t | idleTimeout () const |
| | Returns the idle timeout in milliseconds.
|
| void | setIdleTimeout (std::size_t ms) |
| | Sets the idle timeout in milliseconds.
|
|
std::size_t | maxMessageSize () const |
| | Returns the maximum data message size in bytes.
|
| void | setMaxMessageSize (std::size_t n) |
| | Sets the maximum data message size in bytes.
|
|
Responder * | getResponder (const Request &) |
| | Creates a responder to handle request received by a server.
|
|
void | releaseResponder (Responder *) |
| | Destroys a responder created by a server.
|
◆ onGetSession()
template<typename S, typename Alloc = Allocator>
servlet holds the returned session. loop serializes stream. Return null to decline the upgrade.
Implements WebSocketService.
◆ onReleaseSession()
template<typename S, typename Alloc = Allocator>
Called by the WebSocketServlet that holds the session, while this service is still fully constructed.
Implements WebSocketService.
◆ maxSockets()
| std::size_t maxSockets |
( |
| ) |
const |
|
inherited |
◆ setMaxSockets()
| void setMaxSockets |
( |
std::size_t | n | ) |
|
|
inherited |
A handshake above this limit is answered with 503. Zero means no limit.
◆ setIdleTimeout()
| void setIdleTimeout |
( |
std::size_t | ms | ) |
|
|
inherited |
An accepted socket is closed after ms without a finished transfer. A finished send or receive restarts the timeout. Zero disables it.
◆ setMaxMessageSize()
| void setMaxMessageSize |
( |
std::size_t | n | ) |
|
|
inherited |
A larger data message closes the socket. Zero disables the limit. The count is the declared payload from the first data opcode to FIN.
◆ onUpgrade()
| virtual void onUpgrade |
( |
Stream & | stream | ) |
|
|
finalprotectedvirtualinherited |
Implemented by this class. A derived service uses onGetSession() instead.
Reimplemented from Service.