• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ disconnected函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中disconnected函数的典型用法代码示例。如果您正苦于以下问题:C++ disconnected函数的具体用法?C++ disconnected怎么用?C++ disconnected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了disconnected函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ClientSocket

/*线程启动时调用的函数*/
void ServerThread::run()
{
    _clientSocket = new ClientSocket();
    /*用ServerThread保存的套接字描述符初始化套接字*/
    if(!_clientSocket->setSocketDescriptor(_descriptor))
    {
        qDebug("socket create fail!");
        this->finished();
        return;
    }
    /*连接消息发送信号*/
    connect(this,SIGNAL(sendData(int,qint32,QVariant)),
            _clientSocket,SLOT(sendData(int,qint32,QVariant)));
    /*连接消息到达信号*/
    connect(_clientSocket,SIGNAL(messageArrive(int,qint32,QVariant)),
            this,SIGNAL(messageArrive(int,qint32,QVariant)));
    /*连接客户端断开信号*/
    connect(_clientSocket,SIGNAL(disconnected()),this,SLOT(threadFinished()));
    /*连接数据到达信号*/
    connect(_clientSocket,SIGNAL(readyRead()),_clientSocket,SLOT(readData()));
    exec();
}
开发者ID:AlanForeverAi,项目名称:Exams,代码行数:23,代码来源:server.cpp


示例2: QTcpSocket

squeezeListner::squeezeListner(QObject *parent,QString mIpaddr,QString mPortNr)
 :QObject ( parent )
{
    bool ret;
    ret=false;

    port_nr=mPortNr;
    ip_addr=mIpaddr;
    tcpSocket = new QTcpSocket(this);
    if (QObject::connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(readData1())));
        qDebug()<<"Signal ok";
    QObject::connect(tcpSocket, SIGNAL(disconnected()),this,SLOT(disConnected()));

    tcpSocket->abort();
    tcpSocket->connectToHost(ip_addr,port_nr.toInt());

    if (tcpSocket->waitForConnected(1000))
    {
        ret=true;
        qDebug("Connected!");
    }
}
开发者ID:dubstar-04,项目名称:squeezecontroll,代码行数:22,代码来源:squeezelistner.cpp


示例3: KDSoapServerSocket

KDSoapServerSocket *KDSoapSocketList::handleIncomingConnection(int socketDescriptor)
{
    KDSoapServerSocket *socket = new KDSoapServerSocket(this, m_serverObject);
    socket->setSocketDescriptor(socketDescriptor);

#ifndef QT_NO_OPENSSL
    if (m_server->features() & KDSoapServer::Ssl) {
        // We could call a virtual "m_server->setSslConfiguration(socket)" here,
        // if more control is needed (e.g. due to SNI)
        if (!m_server->sslConfiguration().isNull()) {
            socket->setSslConfiguration(m_server->sslConfiguration());
        }
        socket->startServerEncryption();
    }
#endif

    QObject::connect(socket, SIGNAL(disconnected()),
                     socket, SLOT(deleteLater()));
    m_sockets.insert(socket);
    connect(socket, SIGNAL(socketDeleted(KDSoapServerSocket*)), this, SLOT(socketDeleted(KDSoapServerSocket*)));
    return socket;
}
开发者ID:Augus-Wang,项目名称:KDSoap,代码行数:22,代码来源:KDSoapSocketList.cpp


示例4: QObject

CloudConnection::CloudConnection(const QUrl &authenticationServer, const QUrl &proxyServer, QObject *parent) :
    QObject(parent),
    m_authenticationServerUrl(authenticationServer),
    m_proxyServerUrl(proxyServer),
    m_connected(false),
    m_error(Cloud::CloudErrorNoError)
{
    m_reconnectionTimer = new QTimer(this);
    m_reconnectionTimer->setSingleShot(false);
    connect(m_reconnectionTimer, &QTimer::timeout, this, &CloudConnection::reconnectionTimeout);

    m_connection = new QWebSocket("guhd", QWebSocketProtocol::Version13, this);
    connect(m_connection, SIGNAL(connected()), this, SLOT(onConnected()));
    connect(m_connection, SIGNAL(disconnected()), this, SLOT(onDisconnected()));
    connect(m_connection, SIGNAL(textMessageReceived(QString)), this, SLOT(onTextMessageReceived(QString)));
    connect(m_connection, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onError(QAbstractSocket::SocketError)));

    m_authenticator = new CloudAuthenticator("0631d42ba0464e4ebd4b78b15c53f532", "b7919ebf3bcf48239f348e764744079b", this);
    m_authenticator->setUrl(m_authenticationServerUrl);

    connect(m_authenticator, &CloudAuthenticator::authenticationChanged, this, &CloudConnection::onAuthenticationChanged);
}
开发者ID:ni-cc,项目名称:guh,代码行数:22,代码来源:cloudconnection.cpp


示例5: QWidget

InteractiveSMTPServerWindow::InteractiveSMTPServerWindow( QTcpSocket * socket, QWidget * parent )
  : QWidget( parent ), mSocket( socket )
{
  QPushButton * but;
  Q_ASSERT( socket );

  QVBoxLayout * vlay = new QVBoxLayout( this );

  mTextEdit = new QTextEdit( this );
  vlay->addWidget( mTextEdit, 1 );
  QWidget *mLayoutWidget = new QWidget;
  vlay->addWidget( mLayoutWidget );

  QHBoxLayout * hlay = new QHBoxLayout( mLayoutWidget );
    
  mLineEdit = new QLineEdit( this );
  mLabel = new QLabel( "&Response:", this );
  mLabel->setBuddy( mLineEdit );
  but = new QPushButton( "&Send", this );
  hlay->addWidget( mLabel );
  hlay->addWidget( mLineEdit, 1 );
  hlay->addWidget( but );

  connect( mLineEdit, SIGNAL(returnPressed()), SLOT(slotSendResponse()) );
  connect( but, SIGNAL(clicked()), SLOT(slotSendResponse()) );

  but = new QPushButton( "&Close Connection", this );
  vlay->addWidget( but );

  connect( but, SIGNAL(clicked()), SLOT(slotConnectionClosed()) );

  connect( socket, SIGNAL(disconnected()), SLOT(slotConnectionClosed()) );
  connect( socket, SIGNAL(error(QAbstractSocket::SocketError)),
           SLOT(slotError(QAbstractSocket::SocketError)) );
  connect( socket, SIGNAL(readyRead()), SLOT(slotReadyRead()) );

  mLineEdit->setText( "220 hi there" );
  mLineEdit->setFocus();
}
开发者ID:pvuorela,项目名称:kcalcore,代码行数:39,代码来源:interactivesmtpserver.cpp


示例6: qDebug

//void TcpClientSocket::dataReceived(QString msg)
//{
////        emit updateClients(msg,msg.length());
//}
void TcpClientSocket::dataReceived(){
    QString name=this->readAll();
    if(isfirst==6666){
        qDebug()<<name;
        QStringList tmp=name.split(" ");
        if(q.Iscontent(tmp[0],tmp[2].toInt())){
            classname=tmp[2].toInt();
            if(classname>=3){
                return;
            }
            this->write("yes\n");
            this->write(q.getquestioncontent().toUtf8());
            this->flush();
            this->write(q.avaqueue(classname).toLatin1());
            this->flush();
            this->write("\nmdzz");
            this->flush();
        }else{
            this->write("no");
        }
        qDebug()<< "登陆 ";
    }else{
        qDebug() << "选题内容 " <<name;
        QStringList tmp=name.split("|");
        classname=tmp[2].toInt();
        qDebug() << classname;
        qDebug()<< tmp;
        if(q.selectquestion(tmp[0],classname,tmp[1].toInt())){
            this->write("OK");
            emit disconnected(this->socketDescriptor());
        }else{
            qDebug() << "error\n";
            this->write("error");
            this->write(q.avaqueue(classname).toLatin1());
            this->flush();
        }
        qDebug()<< "选题 ";
    }
}
开发者ID:xyzyx233,项目名称:QT_TcpServer,代码行数:43,代码来源:tcpclientsocket.cpp


示例7: path

/*!
  Constructs an assistant client with the specified \a parent. For
  systems other than Mac OS, \a path specifies the path to the Qt
  Assistant executable. For Mac OS, \a path specifies a directory
  containing a valid assistant.app bundle. If \a path is the empty
  string, the system path (\c{%PATH%} or \c $PATH) is used.
*/
QAssistantClient::QAssistantClient( const QString &path, QObject *parent )
    : QObject( parent ), host ( QLatin1String("localhost") )
{
#if defined(Q_OS_MAC)
    const QString assistant = QLatin1String("Assistant_adp");
#else
    const QString assistant = QLatin1String("assistant_adp");
#endif

    if ( path.isEmpty() )
        assistantCommand = assistant;
    else {
        QFileInfo fi( path );
        if ( fi.isDir() )
            assistantCommand = path + QLatin1String("/") + assistant;
        else
            assistantCommand = path;
    }

#if defined(Q_OS_MAC)
    assistantCommand += QLatin1String(".app/Contents/MacOS/Assistant_adp");
#endif

    socket = new QTcpSocket( this );
    connect( socket, SIGNAL(connected()),
            SLOT(socketConnected()) );
    connect( socket, SIGNAL(disconnected()),
            SLOT(socketConnectionClosed()) );
    connect( socket, SIGNAL(error(QAbstractSocket::SocketError)),
             SLOT(socketError()) );
    opened = false;
    proc = new QProcess( this );
    port = 0;
    pageBuffer = QLatin1String("");
    connect( proc, SIGNAL(readyReadStandardError()),
             this, SLOT(readStdError()) );
    connect( proc, SIGNAL(error(QProcess::ProcessError)),
        this, SLOT(procError(QProcess::ProcessError)) );
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:46,代码来源:qassistantclient.cpp


示例8: Q_D

bool QHttpSocketEngine::initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol)
{
    Q_D(QHttpSocketEngine);
    if (type != QAbstractSocket::TcpSocket)
        return false;

    setProtocol(protocol);
    setSocketType(type);
    d->socket = new QTcpSocket(this);
#ifndef QT_NO_BEARERMANAGEMENT
    d->socket->setProperty("_q_networkSession", property("_q_networkSession"));
#endif

    // Explicitly disable proxying on the proxy socket itself to avoid
    // unwanted recursion.
    d->socket->setProxy(QNetworkProxy::NoProxy);

    // Intercept all the signals.
    connect(d->socket, SIGNAL(connected()),
            this, SLOT(slotSocketConnected()),
            Qt::DirectConnection);
    connect(d->socket, SIGNAL(disconnected()),
            this, SLOT(slotSocketDisconnected()),
            Qt::DirectConnection);
    connect(d->socket, SIGNAL(readyRead()),
            this, SLOT(slotSocketReadNotification()),
            Qt::DirectConnection);
    connect(d->socket, SIGNAL(bytesWritten(qint64)),
            this, SLOT(slotSocketBytesWritten()),
            Qt::DirectConnection);
    connect(d->socket, SIGNAL(error(QAbstractSocket::SocketError)),
            this, SLOT(slotSocketError(QAbstractSocket::SocketError)),
            Qt::DirectConnection);
    connect(d->socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
            this, SLOT(slotSocketStateChanged(QAbstractSocket::SocketState)),
            Qt::DirectConnection);

    return true;
}
开发者ID:phen89,项目名称:rtqt,代码行数:39,代码来源:qhttpsocketengine.cpp


示例9: QTcpSocket

bool NetworkConnection::openConnection(const QString & host, const unsigned short port, bool not_main_connection)
{	
	qsocket = new QTcpSocket();	//try with no parent passed for now
	if(!qsocket)
		return 0;
	//connect signals
	
	//connect(qsocket, SIGNAL(hostFound()), SLOT(OnHostFound()));
	connect(qsocket, SIGNAL(connected()), SLOT(OnConnected()));
	connect(qsocket, SIGNAL(readyRead()), SLOT(OnReadyRead()));
	connect(qsocket, SIGNAL(disconnected ()), SLOT(OnConnectionClosed()));
//	connect(qsocket, SIGNAL(delayedCloseFinished()), SLOT(OnDelayedCloseFinish()));
//	connect(qsocket, SIGNAL(bytesWritten(qint64)), SLOT(OnBytesWritten(qint64)));
    connect(qsocket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(OnError(QAbstractSocket::SocketError)));

	if(qsocket->state() != QTcpSocket::UnconnectedState)
	{
		qDebug("Called openConnection while in state %d", qsocket->isValid());
		return 0;
	}
	//remove asserts later
	Q_ASSERT(host != 0);
	Q_ASSERT(port != 0);

	if(!not_main_connection)
		drawPleaseWait();

	qDebug("Connecting to %s %d...\n", host.toLatin1().constData(), port);
	// assume info.host is clean
	qsocket->connectToHost(host, (quint16) port);
	
	/* If dispatch does not have a UI, the thing that sets the UI
	 * will setupRoomAndConsole */
	/* Tricky now without dispatches... who sets up the UI?
	 * there's always a mainwindow... but maybe things aren't setup? */
	
	/* connectionInfo as a message with those pointers is probably a bad idea */
	return (qsocket->state() != QTcpSocket::UnconnectedState);
}
开发者ID:EPeillard,项目名称:qgo,代码行数:39,代码来源:networkconnection.cpp


示例10: QTcpSocket

void u3HClient::on_clientThread_Started()
{
	m_clientSocket = new QTcpSocket(this);
	if(m_clientSocket->setSocketDescriptor(m_socketDescriptor)) 
	{
		// when data ready to be read
		connect(m_clientSocket, SIGNAL(readyRead()), this, SLOT(on_clientSocket_DataReady()));
		connect(m_clientSocket, SIGNAL(disconnected()), this, SLOT(on_socketDisconnected()));

		packetBuilder *b = new packetBuilder(_hello, newclient);
		b->FinalizePacket();
		SendPacket(b);
	}
	else 
	{
		emit ClientFatalError(m_clientID, tr("Can't set descriptor on socket"));
		emit TerminateClient();
	}

	LogEvent("New client from : " + GetClientEndPointString());

}
开发者ID:und3ath,项目名称:u3h,代码行数:22,代码来源:u3HClient.cpp


示例11: locker

void TestLocalSocket_Peer::onNewConnection(quintptr socketDescriptor)
{
	LocalServer	*	src	=	qobject_cast<LocalServer*>(sender());
	
	if(src == 0)
		return;
	
	QWriteLocker	locker(&m_socketLock);
	
	QVERIFY(m_socket == 0);
	
	m_socket	=	new LocalSocket(this);
	
	connect(m_socket, SIGNAL(socketDescriptorWritten(quintptr)), SLOT(fileDescriptorWritten(quintptr)));
	connect(m_socket, SIGNAL(disconnected()), SLOT(onDisconnected()), Qt::DirectConnection);
	
	m_socket->setSocketDescriptor(socketDescriptor);
	
	QVERIFY(m_socket->open(QIODevice::ReadWrite));
	
	m_socketChanged.wakeAll();
}
开发者ID:HardcorEViruS,项目名称:MessageBus,代码行数:22,代码来源:testlocalsocket_peer.cpp


示例12: connect

void NfcPeerToPeer::handleNewConnection()
{
    if (!m_connectServerSocket)
        return;

    if (m_nfcServerSocket) {
        m_nfcServerSocket->deleteLater();
    }

    // The socket is a child of the server and will therefore be deleted automatically
    m_nfcServerSocket = m_nfcServer->nextPendingConnection();

    connect(m_nfcServerSocket, SIGNAL(readyRead()), this, SLOT(readTextServer()));
    connect(m_nfcServerSocket, SIGNAL(error(QLlcpSocket::SocketError)), this, SLOT(serverSocketError(QLlcpSocket::SocketError)));
    connect(m_nfcServerSocket, SIGNAL(stateChanged(QLlcpSocket::SocketState)), this, SLOT(serverSocketStateChanged(QLlcpSocket::SocketState)));
    connect(m_nfcServerSocket, SIGNAL(disconnected()), this, SLOT(serverSocketDisconnected()));

    if (m_reportingLevel != AppSettings::OnlyImportantReporting) {
        emit statusMessage("New server socket connection");
    }
    sendCachedText();
}
开发者ID:andijakl,项目名称:nfcinteractor,代码行数:22,代码来源:nfcpeertopeer.cpp


示例13: QObject

//----------------------------------------------------------------------------//
// QCanConfig()                                                                 //
// constructor                                                                //
//----------------------------------------------------------------------------//
QCanConfig::QCanConfig(QObject *parent) :
    QObject(parent)
{
   //----------------------------------------------------------------
   // get the instance of the main application
   //
   pclAppP = QCoreApplication::instance();

   
   //----------------------------------------------------------------
   // connect signals for socket operations
   //
   QObject::connect(&clCanSocketP, SIGNAL(connected()),
                    this, SLOT(socketConnected()));

   QObject::connect(&clCanSocketP, SIGNAL(disconnected()),
                    this, SLOT(socketDisconnected()));
   
   QObject::connect(&clCanSocketP, SIGNAL(error(QAbstractSocket::SocketError)),
                    this, SLOT(socketError(QAbstractSocket::SocketError)));
   
}
开发者ID:canpie,项目名称:CANpie,代码行数:26,代码来源:qcan_config.cpp


示例14: out

//! [4]
void Server::sendFortune()
{
//! [5]
    QByteArray block;
    QDataStream out(&block, QIODevice::WriteOnly);
    out.setVersion(QDataStream::Qt_4_0);
//! [4] //! [6]
    out << (quint16)0;
    out << fortunes.at(qrand() % fortunes.size());
    out.device()->seek(0);
    out << (quint16)(block.size() - sizeof(quint16));
//! [6] //! [7]

    QTcpSocket *clientConnection = tcpServer->nextPendingConnection();
    connect(clientConnection, SIGNAL(disconnected()),
            clientConnection, SLOT(deleteLater()));
//! [7] //! [8]

    clientConnection->write(block);
    clientConnection->disconnectFromHost();
//! [5]
}
开发者ID:Kwangsub,项目名称:qt-openwebos,代码行数:23,代码来源:server.cpp


示例15: SkpTcpSocketTest

void SkpSocketTestWidget::skp_on_timer_socket()
{
    int threadIndex = m_connectNumber % THREAD_NUMBER;
    QThread *thread = m_threadList.at(threadIndex);
    m_connectNumber++;

    SkpTcpSocketTest *tcpSocketTest = new SkpTcpSocketTest();

    connect(tcpSocketTest, SIGNAL(connected()), tcpSocketTest, SLOT(skp_on_connect()));
    connect(tcpSocketTest, SIGNAL(readyRead()), tcpSocketTest, SLOT(skp_on_read()));
    connect(tcpSocketTest, SIGNAL(disconnected()), tcpSocketTest, SLOT(skp_on_disconnected()));
    connect(tcpSocketTest, SIGNAL(error(QAbstractSocket::SocketError)),
            tcpSocketTest, SLOT(skp_on_error(QAbstractSocket::SocketError)));

    connect(tcpSocketTest, SIGNAL(skp_sig_quit(qint64, qint64, qint64, qint64)), this, SLOT(skp_on_quit(qint64, qint64, qint64, qint64)));
    connect(tcpSocketTest, SIGNAL(skp_sig_socket_quit(qint64, qint64, qint64, qint64)), this, SLOT(skp_on_socket_quit(qint64, qint64, qint64, qint64)));

    tcpSocketTest->connectToHost(connectIP, connectPort);
    tcpSocketTest->waitForConnected();

    tcpSocketTest->moveToThread(thread);
}
开发者ID:yefy,项目名称:skp,代码行数:22,代码来源:skp_socket_test_widget.cpp


示例16: while

void SockClient::readhandler(){
    int n;
    const int buflen = bufferSize;
    char buffer[buflen];
    CharString writeto;
    
    Logger::GLOBAL.log("[SockClient]  reading thread started");
    
    while(alive){
        
        n = read(sockd, buffer, buflen);
        if (n < 0){
            std::this_thread::sleep_for(std::chrono::milliseconds(5));
            continue;
        }else if(n==0){
            Logger::GLOBAL.log("[SockClient] disconnected from server");
            if(disconnected != 0x0) disconnected(server, this);
            alive = false;
            return;
        }
        
        // post-clear extra data in packet... (Prevents extra cpu usage, clearer data stream)
        for(int i=n-1;i<buflen;i++) buffer[i] = 0;

        if(_clientHandler != 0x0 && n > 1) {
            //CharString d = (server->decryptor!=0x0) ? server->decryptor(CharString(buffer,n)) : CharString(buffer,n); // decrypt
            CharString d = CharString(buffer,n); // decrypt
            _clientHandler(d, writeto, this, exVAL);

            if(writeto.getSize() > 0){
                // segment packet if it is too large.
                sendc(writeto); // encryption in-client
            }
        }
    }
    
    Logger::GLOBAL.log("[SockClient] reading thread ended");
    alive = false;
}
开发者ID:EterniaLogic,项目名称:EterniaLibrary,代码行数:39,代码来源:SockClient.cpp


示例17: QObject

Connection::Connection(QTcpSocket *socket, Server *server)
 : QObject(0), m_socket(socket), m_server(server)
{
  qDebug() << "Connection::Connection()";

  if (! m_socket) {
    qDebug() << "No socket.";
    return;
  }

  if (! m_server) {
    qDebug() << "No server.";
    return;
  }

  QObject::connect(socket, SIGNAL(disconnected()),
                   socket, SLOT(deleteLater()));

  m_close_connection = false;                              // Connection is initially open.
  m_byte_order       = QDataStream::BigEndian;             // Most significant byte first (the default).
  m_sequence_number  = 0;
}
开发者ID:BackupTheBerlios,项目名称:open-egov-svn,代码行数:22,代码来源:Connection.cpp


示例18: QObject

//================================================================================================================================
SocketClass::SocketClass(QTcpSocket *tcpSocket, QObject *parent, int timeOut,  bool terminalkoMode) :
    QObject(parent)
{
    this->terminalkoMode = terminalkoMode;
    this->tcpSocket = tcpSocket;
    this->timeOut = timeOut;
    connect(this->tcpSocket, SIGNAL(readyRead()), this, SLOT(mReadyRead()) );
    connect(this->tcpSocket, SIGNAL(disconnected()), this, SLOT(tellAboutDisConnection()) ); //SLOT(deleteLater()) );
    loclalAddrs = this->tcpSocket->peerAddress().toString();
   loclalAddrsLong = loclalAddrs;

    while(loclalAddrsLong.length() < 15){
        loclalAddrsLong.prepend(" ");
        if(loclalAddrsLong.length() < 15)
            loclalAddrsLong.append(" ");
        else
            break;
    }

//    if(!terminalkoMode)
    QTimer::singleShot(1, this, SLOT(tellAboutConnection()) );
}
开发者ID:HelloZB,项目名称:Peredavalka,代码行数:23,代码来源:socketclass.cpp


示例19: Q_Q

void QLocalSocketPrivate::setErrorString(const QString &function)
{
    Q_Q(QLocalSocket);
    BOOL windowsError = GetLastError();
    QLocalSocket::LocalSocketState currentState = state;

    // If the connectToServer fails due to WaitNamedPipe() time-out, assume ConnectionError  
    if (state == QLocalSocket::ConnectingState && windowsError == ERROR_SEM_TIMEOUT)
        windowsError = ERROR_NO_DATA;

    switch (windowsError) {
    case ERROR_PIPE_NOT_CONNECTED:
    case ERROR_BROKEN_PIPE:
    case ERROR_NO_DATA:
        error = QLocalSocket::ConnectionError;
        errorString = QLocalSocket::tr("%1: Connection error").arg(function);
        state = QLocalSocket::UnconnectedState;
        break;
    case ERROR_FILE_NOT_FOUND:
        error = QLocalSocket::ServerNotFoundError;
        errorString = QLocalSocket::tr("%1: Invalid name").arg(function);
        state = QLocalSocket::UnconnectedState;
        break;
    default:
        error = QLocalSocket::UnknownSocketError;
        errorString = QLocalSocket::tr("%1: Unknown error %2").arg(function).arg(windowsError);
#if defined QLOCALSOCKET_DEBUG
        qWarning() << "QLocalSocket error not handled:" << errorString;
#endif
        state = QLocalSocket::UnconnectedState;
    }

    if (currentState != state) {
        q->emit stateChanged(state);
        if (state == QLocalSocket::UnconnectedState)
            q->emit disconnected();
    }
    emit q->error(error);
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:39,代码来源:qlocalsocket_win.cpp


示例20: QObject

pSocket::pSocket(QTcpSocket *socket, QThread *thread, QAtomicInt& limit) :
    QObject(0), _socket(socket), _packetSize(0), _limit(limit)
{
    connect(_socket, SIGNAL(readyRead()), this, SLOT(onDataReceived()));
    connect(_socket, SIGNAL(disconnected()), this, SLOT(deleteLater()));
//    connect(_socket, SIGNAL(disconnected()), _socket, SLOT(deleteLater()));
    connect(this, SIGNAL(saveFile(QByteArray,QString)), pSaver::inst(), SLOT(save(QByteArray,QString)));

    _socket->setParent(this);
    moveToThread(thread);

#ifdef FUNC_DEBUG
    qDebug() << '\n' << Q_FUNC_INFO << "New connection" << socket->localAddress();
#endif

#ifdef TIME_DEBUG
    if (!dTime) {
        dTime = new QTime;
        dTime->start();
    }
#endif
}
开发者ID:AnatolyRugalev,项目名称:Pastexen,代码行数:22,代码来源:psocket.cpp



注:本文中的disconnected函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ discrete_sound_w函数代码示例发布时间:2022-05-30
下一篇:
C++ disconnectUpdateSignal函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap