nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::WebSocket Class Reference

#include <websocket_link.h>

Public Member Functions

 WebSocket (const WebSocket &)=delete
WebSocket & operator= (const WebSocket &)=delete
 ~WebSocket ()
absl::Status Send (std::string_view bytes)
std::string Take ()
 What's come since the last time.
bool open () const
void Wait (int milliseconds)

Static Public Member Functions

static absl::StatusOr< std::unique_ptr< WebSocket > > Open (const std::string &url)

Detailed Description

A browser's WebSocket, to the gateway: the bytes it's sent, as they come, for whoever reads them. In a browser.

Definition at line 26 of file websocket_link.h.

Constructor & Destructor Documentation

◆ WebSocket()

nanommo::WebSocket::WebSocket ( const WebSocket & )
delete

◆ ~WebSocket()

nanommo::WebSocket::~WebSocket ( )

Definition at line 57 of file websocket_link.cc.

Member Function Documentation

◆ Open()

absl::StatusOr< std::unique_ptr< WebSocket > > nanommo::WebSocket::Open ( const std::string & url)
static

Opens the url, and waits for it to open, letting the page carry on meanwhile, or returns why it didn't.

Definition at line 28 of file websocket_link.cc.

◆ open()

bool nanommo::WebSocket::open ( ) const
inline

Definition at line 42 of file websocket_link.h.

◆ operator=()

WebSocket & nanommo::WebSocket::operator= ( const WebSocket & )
delete

◆ Send()

absl::Status nanommo::WebSocket::Send ( std::string_view bytes)

Definition at line 62 of file websocket_link.cc.

◆ Take()

std::string nanommo::WebSocket::Take ( )

What's come since the last time.

Definition at line 75 of file websocket_link.cc.

◆ Wait()

void nanommo::WebSocket::Wait ( int milliseconds)

Waits for something to come, or the socket to close, letting the page carry on meanwhile, for up to the milliseconds.

Definition at line 77 of file websocket_link.cc.


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