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

#include <TcpServer.h>

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

Public Slots

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

Public Member Functions

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

Static Public Member Functions

static QByteArray CreateMessagePacket (const String &type, const String &data, const String &args=String())
 
static QByteArray CreateFilePacket (const File &file, bool send_file_contents)
 
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 CreatRequestSendFilePacket (const File &file_to_request, const String &args=String())
 
static QByteArray CreateSendErrorPacket (const Exception &e)
 

Static Public Attributes

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

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 socketDisconnected (QTcpSocket *socket)
 
virtual void showError (const Exception &e)
 

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()

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

◆ CreateMessagePacket()

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

◆ CreateOpenAppPacket()

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

◆ CreateOpenFilePacket()

QByteArray CreateOpenFilePacket ( const File & file_to_open)
static

◆ CreateSendErrorPacket()

QByteArray CreateSendErrorPacket ( const Exception & e)
static

◆ CreatRequestSendFilePacket()

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

◆ dataRecieved()

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()

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]

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

◆ sendData() [2/2]

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

◆ sendError()

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

◆ sendFile() [1/2]

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

◆ sendFile() [2/2]

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

◆ sendOpenApp()

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

◆ sendPacket()

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

◆ sendSetScreenResolution()

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

◆ sendShowFileBrowser()

bool sendShowFileBrowser ( QTcpSocket * socket = nullptr)
virtual

◆ showError()

void showError ( const Exception & e)
protectedvirtual

◆ socketDisconnected()

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 files: