void AbstractSocket::connectPrivateSignals() { // Used to manage socket expiration timeout // Expiration delay is reinit when a bytes is writted connect(this, SIGNAL(bytesWritten(qint64)), this, SLOT(onBytesWritten(qint64))); // Used to manage socket expiration timeout // Expiration delay is reinit when data are available is read connect(this, SIGNAL(readyRead()), this, SLOT(onReadyRead())); // Those next signals are used as debug, for now connect(this, SIGNAL(connected()), this, SLOT(onConnected())); connect(this, SIGNAL(disconnected()), this, SLOT(onDisconnected())); connect(this, SIGNAL(error ( QAbstractSocket::SocketError)), this, SLOT(onError ( QAbstractSocket::SocketError))); connect(this, SIGNAL(hostFound ()), this, SLOT(onHostFound ())); connect(this, SIGNAL(proxyAuthenticationRequired ( const QNetworkProxy &, QAuthenticator *)), this, SLOT(onProxyAuthenticationRequired ( const QNetworkProxy &, QAuthenticator *))); connect(this, SIGNAL(stateChanged (QAbstractSocket::SocketState)), this, SLOT(onStateChanged (QAbstractSocket::SocketState))); connect(this, SIGNAL(aboutToClose()), this, SLOT(onAboutToClose())); connect(this, SIGNAL(readChannelFinished()), this, SLOT(onReadChannelFinished())); }
COMDevice::COMDevice() { _port = new QextSerialPort(); QObject::connect(_port, SIGNAL(readyRead()), this, SLOT(onDataAvailable())); QObject::connect(_port, SIGNAL(dsrChanged(bool)), this, SLOT(onDSRChanged(bool))); QObject::connect(_port, SIGNAL(bytesWritten(qint64)), this, SLOT(onBytesWritten(qint64))); _lastError = ERR_NO_ERROR; _pendingBytesInWriting = 0; }
int zz::CSocket::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QTcpSocket::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: sigNewRequest((*reinterpret_cast< zz::CRequest*(*)>(_a[1]))); break; case 1: sigRequestWasSent(); break; case 2: onReadyReed(); break; case 3: onBytesWritten((*reinterpret_cast< qint64(*)>(_a[1]))); break; default: ; } _id -= 4; } return _id; }