A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
Loading...
Searching...
No Matches
a11::net::WebSocketWireServer Class Reference

Accepts inbound WebSocket connections and hands each to a callback. More...

#include <cpp/a11/net/websocket_wire_stream.h>

Inheritance diagram for a11::net::WebSocketWireServer:
[legend]

Classes

struct  State
 

Public Member Functions

 ~WebSocketWireServer ()
 
absl::Status Stop ()
 Stops the server and closes the listening socket.
 
absl::StatusOr< std::uint16_t > port () const
 
bool running () const
 
void *absl_nullable GetImpl () const
 

Static Public Member Functions

static absl::StatusOr< std::shared_ptr< WebSocketWireServer > > Create (OnWebSocketStream on_stream, WebSocketServerOptions options={})
 Starts a WebSocket server accepting A11 connections.
 

Detailed Description

Accepts inbound WebSocket connections and hands each to a callback.

The server-side entry point for hosting an agent over WebSockets: every accepted connection invokes on_stream concurrently with a fresh WebSocketWireStream, which the handler typically drives via Accept().

Constructor & Destructor Documentation

◆ ~WebSocketWireServer()

a11::net::WebSocketWireServer::~WebSocketWireServer ( )

Member Function Documentation

◆ Create()

absl::StatusOr< std::shared_ptr< WebSocketWireServer > > a11::net::WebSocketWireServer::Create ( OnWebSocketStream  on_stream,
WebSocketServerOptions  options = {} 
)
static

Starts a WebSocket server accepting A11 connections.

Parameters
on_streamCallback run for each accepted stream.
optionsListen address, port, path, and TLS/framing settings.
Returns
The running server, or an error status.

◆ GetImpl()

void *absl_nullable a11::net::WebSocketWireServer::GetImpl ( ) const
Returns
An opaque native handle for advanced interop, or nullptr.

◆ port()

absl::StatusOr< std::uint16_t > a11::net::WebSocketWireServer::port ( ) const
Returns
The actual port listened on, resolved even for an ephemeral 0.

◆ running()

bool a11::net::WebSocketWireServer::running ( ) const
Returns
Whether the server is currently accepting connections.

◆ Stop()

absl::Status a11::net::WebSocketWireServer::Stop ( )

Stops the server and closes the listening socket.


The documentation for this class was generated from the following files: