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())); }
void CRegFinishDlg::resolveHost() { CRegWizard *wiz = (CRegWizard *) GetParent(); const char *host = wiz->networkDlg.m_host; if (wiz->networkDlg.m_useProxy && !wiz->networkDlg.m_proxyResolve) getUdpSession()->connect(host, wiz->networkDlg.m_port); else { struct in_addr addr; addr.s_addr = inet_addr(host); if (addr.s_addr != INADDR_NONE) onHostFound(addr); else ((CIcqDlg *) AfxGetMainWnd())->getHostByName(host); } }
NetworkControl::NetworkControl() { client = new Client(); QObject::connect(client, SIGNAL(connected()), this, SLOT(onConnected())); QObject::connect(client, SIGNAL(hostFound()), this, SLOT(onHostFound())); QObject::connect(client, SIGNAL(loggingIn()), this, SLOT(onLoggingIn())); QObject::connect(client, SIGNAL(successfullJoin()), this, SLOT(onConnectionAccepted())); QObject::connect(client, SIGNAL(disconnected()), this, SLOT(onDisconnected())); QObject::connect(client, SIGNAL(presentationReceived(QString, QList<QImage>)), this, SLOT(onPresentationReceived(QString, QList<QImage>))); server = new Server(); QObject::connect(server, SIGNAL(listening()), this, SLOT(onStarted())); QObject::connect(server, SIGNAL(connectionAccepted()), this, SLOT(onClientConnected())); QObject::connect(server, SIGNAL(clientVerified()), this, SLOT(onClientVerified())); QObject::connect(server, SIGNAL(clientLeft()), this, SLOT(onClientLeft())); QObject::connect(server, SIGNAL(closing()), this, SLOT(onClosed())); }
NetworkControl::NetworkControl(PresentationControl* p) { pc = p; QObject::connect(pc, SIGNAL(presentationChanged()), this, SLOT(onPresentationChanged())); QThread* networkThread = new QThread(); client = new Client(); QObject::connect(client, SIGNAL(currentPageReceived(qint64)), pc, SLOT(onCurrenPageChanged(qint64))); QObject::connect(client, SIGNAL(connected()), this, SLOT(onConnected())); QObject::connect(client, SIGNAL(hostFound()), this, SLOT(onHostFound())); QObject::connect(client, SIGNAL(loggingIn()), this, SLOT(onLoggingIn())); QObject::connect(client, SIGNAL(successfullJoin()), this, SLOT(onConnectionAccepted())); QObject::connect(client, SIGNAL(disconnected()), this, SLOT(onDisconnected())); QObject::connect(client, SIGNAL(presentationReceived(QString, QList<QImage>)), this, SLOT(onPresentationReceived(QString, QList<QImage>))); server = new Server(); server->setPresentation(p->getPresentation()); QObject::connect(server, SIGNAL(listening()), this, SLOT(onStarted())); QObject::connect(server, SIGNAL(connectionAccepted()), this, SLOT(onClientConnected())); QObject::connect(server, SIGNAL(clientVerified()), this, SLOT(onClientVerified())); QObject::connect(server, SIGNAL(clientLeft()), this, SLOT(onClientLeft())); QObject::connect(server, SIGNAL(closing()), this, SLOT(onClosed())); }