Http
ws::WebSocket
Standalone WebSocket class.
WebSocket
#include <websocket.h>
class WebSocketDefined in src/http/include/icy/http/websocket.h:365
- Inherits
WebSocketAdapter
List of all members
| Name | Kind | Owner |
|---|---|---|
WebSocket | function | Declared here |
~WebSocket | function | Declared here |
request | function | Declared here |
response | function | Declared here |
_request | variable | Declared here |
_response | variable | Declared here |
Vec | typedef | Declared here |
WebSocketFramer | friend | Inherited from WebSocketAdapter |
socket | variable | Inherited from WebSocketAdapter |
WebSocketAdapter | function | Inherited from WebSocketAdapter |
send | function | Inherited from WebSocketAdapter |
send | function | Inherited from WebSocketAdapter |
sendOwned | function | Inherited from WebSocketAdapter |
sendOwned | function | Inherited from WebSocketAdapter |
shutdown | function | Inherited from WebSocketAdapter |
sendClientRequest | function | Inherited from WebSocketAdapter |
handleClientResponse | function | Inherited from WebSocketAdapter |
handleServerRequest | function | Inherited from WebSocketAdapter |
onHandshakeComplete | function | Inherited from WebSocketAdapter |
framer | variable | Inherited from WebSocketAdapter |
_request | variable | Inherited from WebSocketAdapter |
_response | variable | Inherited from WebSocketAdapter |
_closeState | variable | Inherited from WebSocketAdapter |
~WebSocketAdapter | function | Inherited from WebSocketAdapter |
sendControlFrame | function | Inherited from WebSocketAdapter |
resetFrameState | function | Inherited from WebSocketAdapter |
onSocketConnect | function | Inherited from WebSocketAdapter |
onSocketRecv | function | Inherited from WebSocketAdapter |
onSocketClose | function | Inherited from WebSocketAdapter |
Inherited from WebSocketAdapter
| Kind | Name | Description |
|---|---|---|
friend | WebSocketFramer | |
variable | socket | Pointer to the underlying socket. Sent data will be proxied to this socket. |
function | WebSocketAdapter | Creates a WebSocketAdapter using the given socket, mode and HTTP message objects. |
function | send virtual override | Frames and sends data to the peer's address. |
function | send virtual override | Frames and sends data to a specific peer address (for UDP-backed sockets). |
function | sendOwned virtual override | |
function | sendOwned virtual override | |
function | shutdown virtual | Sends a WebSocket CLOSE frame with the given status code and message, then closes the underlying socket. |
function | sendClientRequest virtual | Client side. |
function | handleClientResponse virtual | Parses the server's HTTP upgrade response and completes the handshake. Any data remaining in the buffer after the HTTP response is re-fed as WebSocket frames. |
function | handleServerRequest virtual | Server side. |
function | onHandshakeComplete virtual | Called when the WebSocket handshake completes. Emits the connect event to downstream handlers. |
variable | framer | |
variable | _request | |
variable | _response | |
variable | _closeState | |
function | ~WebSocketAdapter virtual | |
function | sendControlFrame | |
function | resetFrameState | |
function | onSocketConnect virtual override | Called by the socket on connect; initiates the client handshake. |
function | onSocketRecv virtual override | Called by the socket on each received buffer; handles handshake or frame parsing depending on state. |
function | onSocketClose virtual override | Called by the socket on close; resets framer state. |
Public Methods
| Return | Name | Description |
|---|---|---|
WebSocket | Creates the WebSocket with the given Socket. The Socket should be a TCPSocket or a SSLSocket, depending on the protocol used (ws or wss). | |
~WebSocket virtual | ||
http::Request & | request nodiscard | Returns the HTTP request used during the WebSocket handshake. |
http::Response & | response nodiscard | Returns the HTTP response received during the WebSocket handshake. |
WebSocket
WebSocket(const net::Socket::Ptr & socket)Defined in src/http/include/icy/http/websocket.h:373
Creates the WebSocket with the given Socket. The Socket should be a TCPSocket or a SSLSocket, depending on the protocol used (ws or wss).
~WebSocket
virtual
virtual ~WebSocket()Defined in src/http/include/icy/http/websocket.h:375
request
nodiscard
[[nodiscard]] http::Request & request()Defined in src/http/include/icy/http/websocket.h:378
Returns the HTTP request used during the WebSocket handshake.
response
nodiscard
[[nodiscard]] http::Response & response()Defined in src/http/include/icy/http/websocket.h:381
Returns the HTTP response received during the WebSocket handshake.
Protected Attributes
_request
http::Request _requestDefined in src/http/include/icy/http/websocket.h:384
_response
http::Response _responseDefined in src/http/include/icy/http/websocket.h:385
Public Types
| Name | Description |
|---|---|
Vec |
Vec
using Vec = std::vector< WebSocket >Type: std::vector< WebSocket >
Defined in src/http/include/icy/http/websocket.h:368