5#ifndef PT_HTTP_WEBSOCKETSERVLET_H
6#define PT_HTTP_WEBSOCKETSERVLET_H
8#include <Pt/Http/Api.h>
9#include <Pt/Connectable.h>
10#include <Pt/NonCopyable.h>
67 friend class WebSocketService;
68 friend class WebSocketSession;
92 {
return _sessions.size(); }
95 void onUpgrade(
Stream& stream);
102 std::vector<WebSocketSession*> _sessions;
Connectable()
Default constructor.
One HTTP stream on a connection.
Definition Stream.h:90
Factory and endpoint policy for WebSocket sessions.
Definition WebSocketService.h:107
const WebSocketService & service() const
Returns the service this servlet was constructed with.
Definition WebSocketServlet.h:86
WebSocketService & service()
Returns the service this servlet was constructed with.
Definition WebSocketServlet.h:81
~WebSocketServlet()
Releases every session this servlet still holds.
WebSocketServlet(WebSocketService &service)
Registers this servlet with service.
std::size_t size() const
Returns the number of sessions this servlet holds.
Definition WebSocketServlet.h:91
Server facade of one accepted WebSocket stream.
Definition WebSocketSession.h:126
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
HTTP clients and servers.
Core module.
Definition Allocator.h:33