Torc  0.1
Signals | Public Member Functions | List of all members
TorcWebSocketThread Class Reference

Wraps a TorcQThread around a TorcWebsocket. More...

#include <torcwebsocketthread.h>

Inheritance diagram for TorcWebSocketThread:
[legend]

Signals

void ConnectionEstablished (void)
 
void ConnectionUpgraded (void)
 
void RemoteRequestSignal (TorcRPCRequest *Request)
 
void CancelRequestSignal (TorcRPCRequest *Request)
 
- Signals inherited from TorcQThread
void Started (void)
 
void Finished (void)
 

Public Member Functions

 TorcWebSocketThread (qintptr SocketDescriptor, bool Secure)
 
 TorcWebSocketThread (const QHostAddress &Address, quint16 Port, bool Secure, TorcWebSocketReader::WSSubProtocol Protocol=TorcWebSocketReader::SubProtocolJSONRPC)
 
 ~TorcWebSocketThread ()=default
 
void Start (void) override
 
void Finish (void) override
 
void RemoteRequest (TorcRPCRequest *Request)
 
void CancelRequest (TorcRPCRequest *Request)
 
bool IsSecure (void)
 
- Public Member Functions inherited from TorcQThread
 TorcQThread (const QString &Name)
 
virtual ~TorcQThread ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from TorcQThread
static void SetMainThread (void)
 
static bool IsMainThread (void)
 
static void InitRand (void)
 
- Protected Member Functions inherited from TorcQThread
virtual void run (void)
 
void Initialise (void)
 Performs Torc specific thread initialisation. More...
 
void Deinitialise (void)
 Performs Torc specific thread cleanup. More...
 

Detailed Description

Wraps a TorcQThread around a TorcWebsocket.

A simple wrapper that creates and runs a TorcWebSocket in its own thread and passes through RemoteRequest and CancelRequest calls. TorcWebSocket is parent 'agnostic'.

The two different constructors either upgrade an incoming socket to a WebSocket or create a socket and connect to a remote server.

See also
TorcWebsocket
TorcQThread
TorcHTTPRequest
Todo:
Investigate edge case leak when RemoteRequest or CancelRequest possibly might not be delivered during socket or application shutdown. Is this a real issue? (N.B. Only applies when signals are asynchronous i.e. running inside TorcWebSocketThread).

Definition at line 11 of file torcwebsocketthread.h.

Constructor & Destructor Documentation

TorcWebSocketThread::TorcWebSocketThread ( qintptr  SocketDescriptor,
bool  Secure 
)

Definition at line 62 of file torcwebsocketthread.cpp.

TorcWebSocketThread::TorcWebSocketThread ( const QHostAddress &  Address,
quint16  Port,
bool  Secure,
TorcWebSocketReader::WSSubProtocol  Protocol = TorcWebSocketReader::SubProtocolJSONRPC 
)

Definition at line 73 of file torcwebsocketthread.cpp.

TorcWebSocketThread::~TorcWebSocketThread ( )
default

Member Function Documentation

void TorcWebSocketThread::CancelRequest ( TorcRPCRequest Request)

Definition at line 334 of file torcwebsocketthread.cpp.

void TorcWebSocketThread::CancelRequestSignal ( TorcRPCRequest Request)
signal
void TorcWebSocketThread::ConnectionEstablished ( void  )
signal
void TorcWebSocketThread::ConnectionUpgraded ( void  )
signal
void TorcWebSocketThread::Finish ( void  )
overridevirtual

Implements TorcQThread.

Definition at line 317 of file torcwebsocketthread.cpp.

bool TorcWebSocketThread::IsSecure ( void  )

Definition at line 324 of file torcwebsocketthread.cpp.

void TorcWebSocketThread::RemoteRequest ( TorcRPCRequest Request)

Definition at line 329 of file torcwebsocketthread.cpp.

void TorcWebSocketThread::RemoteRequestSignal ( TorcRPCRequest Request)
signal
void TorcWebSocketThread::Start ( void  )
overridevirtual

Implements TorcQThread.

Definition at line 297 of file torcwebsocketthread.cpp.


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