libXpertMass Developer Documentation
  • libXpertMass
  • MassDataServerThread
  • MassDataServerThread Class

    class MsXpS::libXpertMass::MassDataServerThread

    The MassDataServerThread class provides a server in a QThread instance. More...

    Header: #include <MassDataServerThread.hpp>
    Inherits: QThread

    Public Functions

    MassDataServerThread(qintptr socket_descriptor, const QByteArray &data, QObject *parent)
    virtual ~MassDataServerThread()

    Reimplemented Public Functions

    virtual void run() override

    Protected Variables

    QByteArray m_data
    qintptr m_socketDescriptor
    QTcpSocket *mpa_tcpSocket

    Detailed Description

    Member Function Documentation

    MassDataServerThread::MassDataServerThread(qintptr socket_descriptor, const QByteArray &data, QObject *parent)

    Constructs a MassDataServerThread instance.

    [virtual noexcept] MassDataServerThread::~MassDataServerThread()

    Destructs this MassDataServerThread instance.

    Deletes mpa_tcpSocket if non-nullptr.

    [override virtual] void MassDataServerThread::run()

    Reimplements: QThread::run().

    Runs the task in this thread.

    Allocates a new QTcpSocket and sets the m_socketDescriptor. If the member m_data are not empty, writes the data to the socket and disconnects.

    Member Variable Documentation

    QByteArray MassDataServerThread::m_data

    This variable holds the data to be served.

    qintptr MassDataServerThread::m_socketDescriptor

    This variable holds the socket descriptor of the connection.

    QTcpSocket *MassDataServerThread::mpa_tcpSocket

    This variable holds the socket to be used for the connection.