Skip to content
azuriel edited this page Nov 8, 2010 · 1 revision

QWSClient

QWSClient(QObject* parent, QWS_SOCK_BASE* sock, int id) : QObject(*new QWSClientPrivate, parent), command(0), cid(id)

I believe that QT_NO_QWS_MULTIPROCESS is not defined for our purposes, so take the else or ifndef case as appropriate.

This function sets up the QWS_SOCK_BASE socket passed in, which is a QAbstractSocket. It then connects the socket's readyRead, disconnected, and SocketError signals to QWSClient slots.

sendEvent(QWSEvent* event)

This is the key function that uses the socket to send events. It also expects a QAbstractSocket, and is used by a bunch of other QWSClient functions to handle different events. It checks to see if the socket is QAbstractSocket::ConnectedState and writes it to the socket if so, else, it enqueues it for later. The else is sort of an error condition for if there's a send before the socket is initialized, we might not need to worry about it.