36#ifdef _QX_ENABLE_QT_NETWORK
37#ifndef _QX_SERVICE_THREAD_H_
38#define _QX_SERVICE_THREAD_H_
51#ifdef _QX_NO_PRECOMPILED_HEADER
63#include <QtNetwork/qtcpsocket.h>
66#include <QtNetwork/qsslsocket.h>
67#include <QtNetwork/qsslconfiguration.h>
68#include <QtNetwork/qsslcertificate.h>
69#include <QtNetwork/qsslerror.h>
70#include <QtNetwork/qsslkey.h>
77#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
78#define QX_TYPE_SOCKET_DESC qintptr
80#define QX_TYPE_SOCKET_DESC int
111 QxThread(
QxThreadPool * pool, QThread * thread) : QObject(), m_iSocketDescriptor(0), m_pThreadPool(pool), m_pThread(thread), m_bIsStopped(false), m_bIsDisconnected(false) {
qAssert(m_pThreadPool);
qAssert(m_pThread); }
List of parameters to compile and build QxOrm library.
#define QX_TYPE_SOCKET_DESC
Transaction of QxService module (contains request from client and reply from server)
qx::service::QxThread : thread to execute a transaction of QxService module
QxTransaction_ptr m_pTransaction
Current service transaction.
void onSocketDisconnected()
void incomingConnection()
void onSocketSSLPeerVerifyError(const QSslError &error)
void onCustomRequestHandler()
bool m_bIsDisconnected
Socket has been disconnected.
QX_TYPE_SOCKET_DESC m_iSocketDescriptor
Socket descriptor to retrieve 'QTcpSocket'.
QThread * m_pThread
Thread where this worker is executed.
void doProcess(QTcpSocket &socket)
void transactionStarted(qx::service::QxTransaction_ptr transaction)
bool checkKeepAlive(QTcpSocket &socket)
bool checkSocketSSLEncrypted(QTcpSocket *socket)
void customRequestHandler(qx::service::QxTransaction_ptr transaction)
void error(const QString &err, qx::service::QxTransaction_ptr transaction)
bool m_bIsStopped
Set this flag to 'true' to terminate thread.
QMutex m_mutex
Mutex => 'QxThread' is thread-safe.
void onIncomingConnection()
QxThreadPool * m_pThreadPool
Parent thread pool to set available.
QxThread(QxThreadPool *pool, QThread *thread)
void transactionFinished(qx::service::QxTransaction_ptr transaction)
QSslSocket * initSocketSSL()
void onSocketSSLEncrypted()
void onSocketSSLErrors(const QList< QSslError > &errors)
QX_TYPE_SOCKET_DESC getSocketDescriptor()
void execute(QX_TYPE_SOCKET_DESC socketDescriptor)
qx::service::QxThreadPool : thread-safe thread pool to manage list of threads for executing all trans...
std::shared_ptr< QxTransaction > QxTransaction_ptr
Root namespace for all QxOrm library features.