Base Framework
Classes | Public Types | Public Member Functions | List of all members
WebSocket Class Reference

#include <base/net/WebSocket.h>

Inherits Object.

Classes

class  Event
 

Public Types

enum  ReadyState { CONNECTING = 0, OPEN = 1, CLOSING = 2, CLOSED = 3 }
 

Public Member Functions

bool isSupported ()
 
 WebSocket ()
 
ReadyState getReadyState ()
 
bool open (const String &url, const String &protocols=String())
 
void send (const String &body=String())
 
void close ()
 

Detailed Description

WebSocket. See RFC6455.

Constructor & Destructor Documentation

◆ WebSocket()

WebSocket::WebSocket ( )

Initializes the request.

Member Function Documentation

◆ isSupported()

bool WebSocket::isSupported ( )

Returns true if WebSocket is supported.

◆ open()

bool WebSocket::open ( const String url,
const String protocols = String() 
)

Opens socket.

Parameters
urlThe connection url.

◆ send()

void WebSocket::send ( const String body = String())

Sends request.