Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::HttpWebSocketEndpoint Struct Reference

Small frame-lifecycle helper for ping / pong, close, and explicit fixed-buffer send backpressure. More...

#include <HttpWebSocket.h>

Public Member Functions

void reset (HttpWebSocketEndpointRole endpointRole)
 
void setAutomaticMaskKey (const uint8_t maskKey[4])
 
Result receive (Span< char > data, size_t &consumedBytes)
 
Result sendFrame (const HttpWebSocketFrameHeaderView &header, Span< const char > payload, Span< char > storage, Span< const char > &encodedFrame)
 
Result sendData (HttpWebSocketOpcode opcode, Span< const char > payload, bool fin, const uint8_t *maskKey, Span< char > storage, Span< const char > &encodedFrame)
 
Result sendPing (Span< const char > payload, const uint8_t *maskKey, Span< char > storage, Span< const char > &encodedFrame)
 
Result sendPong (Span< const char > payload, const uint8_t *maskKey, Span< char > storage, Span< const char > &encodedFrame)
 
Result sendClose (uint16_t statusCode, Span< const char > reason, const uint8_t *maskKey, Span< char > storage, Span< const char > &encodedFrame)
 
bool hasPendingControlFrame () const
 
Span< const char > getPendingControlFrame () const
 Returns an empty view when no automatic control frame is pending.
 
void clearPendingControlFrame ()
 
bool hasCloseBeenSent () const
 
bool hasCloseBeenReceived () const
 

Public Attributes

Function< Result(const HttpWebSocketFrameHeaderView &)> onFrameHeader
 
Function< Result(HttpWebSocketOpcode, Span< char >, bool)> onDataFramePayload
 
Function< Result(Span< char >)> onPing
 
Function< Result(Span< char >)> onPong
 
Function< Result(uint16_t, Span< char >)> onClose
 

Detailed Description

Small frame-lifecycle helper for ping / pong, close, and explicit fixed-buffer send backpressure.

Member Function Documentation

◆ getPendingControlFrame()

Span< const char > SC::HttpWebSocketEndpoint::getPendingControlFrame ( ) const
inlinenodiscard

Returns an empty view when no automatic control frame is pending.

Note
The view borrows this endpoint's storage until the frame is cleared or another frame is queued.

The documentation for this struct was generated from the following file: