Anklang-0.3.0.dev797+g4e3241f3 anklang-0.3.0.dev797+g4e3241f3
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Ase::WebSocketConnection Class Referenceabstract
Inheritance diagram for Ase::WebSocketConnection:
[legend]

Classes

struct  Info
 
struct  Internals
 

Public Member Functions

bool is_open () const
 
String nickname ()
 
void log_status (int status, const String &filepath="")
 
virtual void http_request ()
 Independent of socket ops.
 
virtual bool authenticated (const std::string &token)
 Return true to allow validate().
 
virtual int validate ()
 Return true to allow opened().
 
virtual void failed ()
 Never folloed by opened().
 
virtual void opened ()
 Pairs with closed().
 
virtual void message (const String &message)
 Only if opened.
 
virtual void closed ()
 Pairs with opened().
 
virtual void log (const String &message)
 
bool send_text (const String &message)
 Returns true if text message was sent.
 
bool send_binary (const String &blob)
 Returns true if binary blob was sent.
 
- Public Member Functions inherited from std::enable_shared_from_this< WebSocketConnection >
enable_shared_from_this (T... args)
 
operator= (T... args)
 
shared_from_this (T... args)
 
weak_from_this (T... args)
 
~enable_shared_from_this (T... args)
 

Protected Member Functions

Info get_info ()
 
 WebSocketConnection (Internals &internals, int logflags)
 

Protected Attributes

const int logflags_
 

Friends

class WebSocketServer
 

Detailed Description

Definition at line 12 of file websocket.hh.


Class Documentation

◆ Ase::WebSocketConnection::Info

struct Ase::WebSocketConnection::Info

Definition at line 16 of file websocket.hh.

Class Members
function< String(String)> header
String local
int lport
String remote
int rport
StringS subs

Constructor & Destructor Documentation

◆ ~WebSocketConnection()

Ase::WebSocketConnection::~WebSocketConnection ( )
protectedpure virtual

Definition at line 396 of file websocket.cc.

◆ WebSocketConnection()

Ase::WebSocketConnection::WebSocketConnection ( Internals internals,
int  logflags 
)
explicitprotected

Definition at line 389 of file websocket.cc.

Member Function Documentation

◆ authenticated()

bool Ase::WebSocketConnection::authenticated ( const std::string token)
virtual

Return true to allow validate().

Definition at line 541 of file websocket.cc.

References std::string::empty(), and Ase::Re::grep().

Referenced by http_request().

◆ closed()

void Ase::WebSocketConnection::closed ( )
virtual

Pairs with opened().

Definition at line 537 of file websocket.cc.

◆ failed()

void Ase::WebSocketConnection::failed ( )
virtual

Never folloed by opened().

Definition at line 534 of file websocket.cc.

◆ get_info()

WebSocketConnection::Info Ase::WebSocketConnection::get_info ( )
protected

Definition at line 464 of file websocket.cc.

◆ http_request()

void Ase::WebSocketConnection::http_request ( )
virtual

◆ is_open()

bool Ase::WebSocketConnection::is_open ( ) const

Definition at line 402 of file websocket.cc.

◆ log()

void Ase::WebSocketConnection::log ( const String message)
virtual

Definition at line 538 of file websocket.cc.

◆ log_status()

void Ase::WebSocketConnection::log_status ( int  status,
const String filepath = "" 
)

Definition at line 371 of file websocket.cc.

◆ message()

void Ase::WebSocketConnection::message ( const String message)
virtual

Only if opened.

Definition at line 536 of file websocket.cc.

Referenced by send_text().

◆ nickname()

String Ase::WebSocketConnection::nickname ( )

Definition at line 492 of file websocket.cc.

◆ opened()

void Ase::WebSocketConnection::opened ( )
virtual

Pairs with closed().

Definition at line 535 of file websocket.cc.

◆ send_binary()

bool Ase::WebSocketConnection::send_binary ( const String blob)

Returns true if binary blob was sent.

Definition at line 433 of file websocket.cc.

References ASE_UNLIKELY, std::string::data(), return_unless, std::string::size(), and Ase::string_format().

◆ send_text()

bool Ase::WebSocketConnection::send_text ( const String message)

Returns true if text message was sent.

Definition at line 408 of file websocket.cc.

References assert_return, message(), return_unless, and Ase::string_format().

◆ validate()

int Ase::WebSocketConnection::validate ( )
virtual

Return true to allow opened().

Definition at line 533 of file websocket.cc.

Friends And Related Symbol Documentation

◆ WebSocketServer

friend class WebSocketServer
friend

Definition at line 13 of file websocket.hh.

Member Data Documentation

◆ logflags_

const int Ase::WebSocketConnection::logflags_
protected

Definition at line 38 of file websocket.hh.


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