API Documentation
Loading...
Searching...
No Matches
TcpServer Class Reference

A TcpServer allows the software to recieve socket connections from external sources. More...

#include <TcpServer.h>

Inheritance diagram for TcpServer:
[legend]
Collaboration diagram for TcpServer:
[legend]

Public Slots

void discardSocketSlot ()
 
void displayErrorSlot (int socketError)
 
void newConnectionSlot ()
 
void readSocketSlot ()
 

Public Member Functions

void connectToRemoteServer (const String &remote_address)
 
void connectToRemoteServer (QTcpSocket *remote_socket)
 
virtual bool sendData (const String &data, QTcpSocket *socket=nullptr)
 
virtual bool sendData (const String &data_type, const String &data, QTcpSocket *socket=nullptr)
 
virtual bool sendError (const Exception &e, QTcpSocket *socket=nullptr)
 
virtual bool sendFile (const File &file, bool send_file_contents, QTcpSocket *socket=nullptr)
 
virtual bool sendFile (const File &file, QTcpSocket *socket=nullptr)
 
virtual bool sendOpenApp (const File &application, const String &args, bool wait_for_completion, bool windowless, QTcpSocket *socket=nullptr)
 
virtual bool sendPacket (const QByteArray &packet, QTcpSocket *socket=nullptr)
 
virtual bool sendSetScreenResolution (const Vector< 2, uint04 > &size, QTcpSocket *socket=nullptr)
 
virtual bool sendShowFileBrowser (QTcpSocket *socket=nullptr)
 
 TcpServer (const String &server_name, QObject *parent=0)
 
 TcpServer (const String &server_name, uint04 port, QObject *parent=0)
 

Static Public Member Functions

static QByteArray CreateFilePacket (const File &file, bool send_file_contents)
 
static QByteArray CreateMessagePacket (const String &type, const String &data, const String &args=String())
 
static QByteArray CreateOpenAppPacket (const File &application, const String &args=String(), bool wait_for_completion=true, bool windowless=false)
 
static QByteArray CreateOpenFilePacket (const File &file_to_open)
 
static QByteArray CreateSendErrorPacket (const Exception &e)
 
static QByteArray CreatRequestSendFilePacket (const File &file_to_request, const String &args=String())
 

Static Public Attributes

static constexpr const char * error_data_message = "send_error_message"
 
static constexpr const char * generic_data_message_type = "data"
 
static constexpr const char * generic_file_message_type = "file"
 
static constexpr const char * open_file_message_type = "open_file"
 
static constexpr const char * open_os_settings = "open_os_settings"
 
static constexpr const char * request_send_file = "request_send_file"
 
static constexpr const char * set_screen_resolution = "set_screen_resolution"
 
static constexpr const char * start_application_file_message_type = "start_application"
 

Protected Member Functions

virtual bool dataRecieved (const String &data_type, const String &args, const String &data, QTcpSocket *socket)
 
virtual bool fileRecieved (const String &data_type, const String &args, const File &data, QTcpSocket *socket)
 
virtual void showError (const Exception &e)
 
virtual void socketDisconnected (QTcpSocket *socket)
 

Detailed Description

A TcpServer allows the software to recieve socket connections from external sources.


Constructor & Destructor Documentation

◆ TcpServer() [1/2]

TcpServer ( const String & server_name,
uint04 port,
QObject * parent = 0 )
explicit

◆ TcpServer() [2/2]

TcpServer ( const String & server_name,
QObject * parent = 0 )
explicit

Member Function Documentation

◆ connectToRemoteServer() [1/2]

void connectToRemoteServer ( const String & remote_address)

◆ connectToRemoteServer() [2/2]

void connectToRemoteServer ( QTcpSocket * remote_socket)

◆ CreateFilePacket()

static QByteArray CreateFilePacket ( const File & file,
bool send_file_contents )
static

◆ CreateMessagePacket()

static QByteArray CreateMessagePacket ( const String & type,
const String & data,
const String & args = String() )
static

◆ CreateOpenAppPacket()

static QByteArray CreateOpenAppPacket ( const File & application,
const String & args = String(),
bool wait_for_completion = true,
bool windowless = false )
static

◆ CreateOpenFilePacket()

static QByteArray CreateOpenFilePacket ( const File & file_to_open)
static

◆ CreateSendErrorPacket()

static QByteArray CreateSendErrorPacket ( const Exception & e)
static

◆ CreatRequestSendFilePacket()

static QByteArray CreatRequestSendFilePacket ( const File & file_to_request,
const String & args = String() )
static

◆ dataRecieved()

virtual bool dataRecieved ( const String & data_type,
const String & args,
const String & data,
QTcpSocket * socket )
protectedvirtual

◆ discardSocketSlot

void discardSocketSlot ( )
slot

◆ displayErrorSlot

void displayErrorSlot ( int socketError)
slot

◆ fileRecieved()

virtual bool fileRecieved ( const String & data_type,
const String & args,
const File & data,
QTcpSocket * socket )
protectedvirtual

◆ newConnectionSlot

void newConnectionSlot ( )
slot

◆ readSocketSlot

void readSocketSlot ( )
slot

◆ sendData() [1/2]

virtual bool sendData ( const String & data,
QTcpSocket * socket = nullptr )
virtual

◆ sendData() [2/2]

virtual bool sendData ( const String & data_type,
const String & data,
QTcpSocket * socket = nullptr )
virtual

◆ sendError()

virtual bool sendError ( const Exception & e,
QTcpSocket * socket = nullptr )
virtual

◆ sendFile() [1/2]

virtual bool sendFile ( const File & file,
bool send_file_contents,
QTcpSocket * socket = nullptr )
virtual

◆ sendFile() [2/2]

virtual bool sendFile ( const File & file,
QTcpSocket * socket = nullptr )
virtual

◆ sendOpenApp()

virtual bool sendOpenApp ( const File & application,
const String & args,
bool wait_for_completion,
bool windowless,
QTcpSocket * socket = nullptr )
virtual

◆ sendPacket()

virtual bool sendPacket ( const QByteArray & packet,
QTcpSocket * socket = nullptr )
virtual

◆ sendSetScreenResolution()

virtual bool sendSetScreenResolution ( const Vector< 2, uint04 > & size,
QTcpSocket * socket = nullptr )
virtual

◆ sendShowFileBrowser()

virtual bool sendShowFileBrowser ( QTcpSocket * socket = nullptr)
virtual

◆ showError()

virtual void showError ( const Exception & e)
protectedvirtual

◆ socketDisconnected()

virtual void socketDisconnected ( QTcpSocket * socket)
protectedvirtual

Member Data Documentation

◆ error_data_message

const char* error_data_message = "send_error_message"
staticconstexpr

◆ generic_data_message_type

const char* generic_data_message_type = "data"
staticconstexpr

◆ generic_file_message_type

const char* generic_file_message_type = "file"
staticconstexpr

◆ open_file_message_type

const char* open_file_message_type = "open_file"
staticconstexpr

◆ open_os_settings

const char* open_os_settings = "open_os_settings"
staticconstexpr

◆ request_send_file

const char* request_send_file = "request_send_file"
staticconstexpr

◆ set_screen_resolution

const char* set_screen_resolution = "set_screen_resolution"
staticconstexpr

◆ start_application_file_message_type

const char* start_application_file_message_type = "start_application"
staticconstexpr

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