RetroArch
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
RpcConnection Struct Reference

#include <rpc_connection.h>

Collaboration diagram for RpcConnection:
[legend]

Classes

struct  MessageFrame
 
struct  MessageFrameHeader
 

Public Types

enum  ErrorCode : int { ErrorCode::Success = 0, ErrorCode::PipeClosed = 1, ErrorCode::ReadCorrupt = 2 }
 
enum  Opcode : uint32_t {
  Opcode::Handshake = 0, Opcode::Frame = 1, Opcode::Close = 2, Opcode::Ping = 3,
  Opcode::Pong = 4
}
 
enum  State : uint32_t { State::Disconnected, State::SentHandshake, State::AwaitingResponse, State::Connected }
 

Public Member Functions

bool IsOpen () const
 
void Open ()
 
void Close ()
 
bool Write (const void *data, size_t length)
 
bool Read (JsonDocument &message)
 

Static Public Member Functions

static RpcConnectionCreate (const char *applicationId)
 
static void Destroy (RpcConnection *&)
 

Public Attributes

BaseConnectionconnection {nullptr}
 
State state {State::Disconnected}
 
void(* onConnect )(JsonDocument &message)
 
void(* onDisconnect )(int errorCode, const char *message)
 
char appId [64] {}
 
int lastErrorCode {0}
 
char lastErrorMessage [256] {}
 
RpcConnection::MessageFrame sendFrame
 

Member Enumeration Documentation

◆ ErrorCode

enum RpcConnection::ErrorCode : int
strong
Enumerator
Success 
PipeClosed 
ReadCorrupt 

◆ Opcode

Enumerator
Handshake 
Frame 
Close 
Ping 
Pong 

◆ State

Enumerator
Disconnected 
SentHandshake 
AwaitingResponse 
Connected 

Member Function Documentation

◆ Close()

void RpcConnection::Close ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Create()

RpcConnection * RpcConnection::Create ( const char *  applicationId)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Destroy()

void RpcConnection::Destroy ( RpcConnection *&  c)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsOpen()

bool RpcConnection::IsOpen ( ) const
inline
Here is the caller graph for this function:

◆ Open()

void RpcConnection::Open ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read()

bool RpcConnection::Read ( JsonDocument message)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write()

bool RpcConnection::Write ( const void data,
size_t  length 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ appId

char RpcConnection::appId[64] {}

◆ connection

BaseConnection* RpcConnection::connection {nullptr}

◆ lastErrorCode

int RpcConnection::lastErrorCode {0}

◆ lastErrorMessage

char RpcConnection::lastErrorMessage[256] {}

◆ onConnect

void(* RpcConnection::onConnect) (JsonDocument &message)
inline

◆ onDisconnect

void(* RpcConnection::onDisconnect) (int errorCode, const char *message)
inline

◆ sendFrame

RpcConnection::MessageFrame RpcConnection::sendFrame

◆ state

State RpcConnection::state {State::Disconnected}

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