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

C++ connectionClosed函数代码示例

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

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



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

示例1: QMainWindow

ICMainWindow::ICMainWindow(ICServer *theServer, QWidget *parent) :
    QMainWindow(parent), server(theServer), questionDialog(new ICNewQuestionDialog(this)),
    onCanvas(false)
{
    setupUi(this);

    setWindowIcon(QIcon(":/images/icimage.png"));

    //this->setAttribute(Qt::WA_TranslucentBackground, true);
    setWindowFlags(Qt::FramelessWindowHint);
    //questionDialog->setWindowOpacity(0.8);
    questionDialog->setWindowFlags(questionDialog->windowFlags() | Qt::FramelessWindowHint);

    connect(exitButton, SIGNAL(clicked()), this, SLOT(close()));
    connect(minimizeButton, SIGNAL(clicked()), this, SLOT(showMinimized()));

    connect(understandButton, SIGNAL(clicked()), this, SLOT(understand()));
    connect(questionButton, SIGNAL(clicked()), this, SLOT(question()));
    connect(stopButton, SIGNAL(clicked()), this, SLOT(stop()));

    connect(server, SIGNAL(newAnswerArrived(QString)), this, SLOT(newAnswerArrived(QString)));
    connect(server, SIGNAL(connectionClosed()), this, SLOT(connectionClosed()));

    connect(questionDialog, SIGNAL(newQuestion(int,int)), this, SLOT(newQuestionReady(int,int)));

    sidLabel->setText(server->getIdentifier());
    countLabel->setText("0/0");
}
开发者ID:hzzlzz,项目名称:InteractiveCourse,代码行数:28,代码来源:icmainwindow.cpp


示例2: QSocket

ClientSocket::ClientSocket( int sock, InfoData *i, QObject *parent, const char *name ) :
    QSocket( parent, name ), info( i )
{
    connect( this, SIGNAL(readyRead()), SLOT(readClient()) );
    connect( this, SIGNAL(connectionClosed()), SLOT(connectionClosed()) );
    setSocket( sock );
}
开发者ID:aroraujjwal,项目名称:qt3,代码行数:7,代码来源:server.cpp


示例3: QObject

ClientSocket::ClientSocket( QObject *parent, QTcpSocket * socket, unsigned int maximum_len) :
  QObject( parent),
  sock(socket),
  maxLen(maximum_len)
{
      connect( sock, SIGNAL(readyRead()), this, SLOT(readClient()) );
      connect( sock, SIGNAL(connectionClosed()), this, SLOT(connectionClosed()) );
}
开发者ID:CURG,项目名称:graspit_bci,代码行数:8,代码来源:graspitServer.cpp


示例4: FQTermSocket

FQTermTelnetSocket::FQTermTelnetSocket()
    : FQTermSocket() {
  private_socket_ = new FQTermSocketPrivate();
  FQ_VERIFY(connect(private_socket_, SIGNAL(connected()), this, SIGNAL(connected())));
  FQ_VERIFY(connect(private_socket_, SIGNAL(hostFound()), this, SIGNAL(hostFound())));
  FQ_VERIFY(connect(private_socket_, SIGNAL(connectionClosed()), this, SIGNAL(connectionClosed())));
  FQ_VERIFY(connect(private_socket_, SIGNAL(delayedCloseFinished()),
                    this, SIGNAL(delayedCloseFinished())));
  FQ_VERIFY(connect(private_socket_, SIGNAL(readyRead()), this, SIGNAL(readyRead())));
  FQ_VERIFY(connect(private_socket_, SIGNAL(error(QAbstractSocket::SocketError)), this, SIGNAL(error(QAbstractSocket::SocketError))));
  FQ_VERIFY(connect(private_socket_, SIGNAL(socketState(int)), this, SIGNAL(socketState(int))));
}
开发者ID:ashang,项目名称:fqterm,代码行数:12,代码来源:fqterm_telnet_socket.cpp


示例5: disconnectedError

void RdpView::connectionError(const QString &text, const QString &caption)
{
    m_quitFlag = true;
    KMessageBox::error(0, text, caption);
    emit disconnectedError();
    connectionClosed(ForceClose);
}
开发者ID:KDE,项目名称:krdc,代码行数:7,代码来源:rdpview.cpp


示例6: QSocket

void panel_control_hand::crearSocketSlot() {
	std::ostringstream pcout;
    // Creamdo el socket y conxión de varias de sus señales

    if (haySocket==0)
    {
    socket = new QSocket( this );
	timer_socket = new QTimer( this );
	timer_socket->start(400, TRUE);

    connect( socket, SIGNAL(connected()), SLOT(SocketConectadoSlot()) );
    connect( socket, SIGNAL(connectionClosed()), SLOT(SocketConexionCerradaSlot()) );
    connect( socket, SIGNAL(error(int)), SLOT(SocketErrorSlot(int)) );
	connect( timer_socket, SIGNAL(timeout()), this, SLOT(enviarDatoAlServidorSlot()) );

    //  IP remota y puerto que utilizara el Socket
    pcout << "Connectant al servidor" << std::endl;
	kinechain->send_stream (pcout);
    socket->connectToHost( "147.83.37.84", 4242 );
    }
    else
    {
    connect_active = TRUE;
    timer_socket->start(400, TRUE);
    pcout << "Connexió reiniciada" << std::endl;
    kinechain->send_stream (pcout);
    }

}
开发者ID:BackupTheBerlios,项目名称:qilex-svn,代码行数:29,代码来源:panel_control_hand.cpp


示例7: error

void TcpThread::run()
{
	/**
	* 内存泄漏检查
	*/
	//_CrtDumpMemoryLeaks();
	//
	TotalBytes = 0;  
	bytesReceived = 0;  
	fileNameSize = 0;  
	blockSize = 0;
	loadSize = 4*1024;
	bytesToWrite = 0;
	bytesWritten = 0;
	blFileOpen = false;
	blerror = false;
	upload_AND_download_Path = "G:\\TEEData\\";
	m_searchPath = "G:\\TEEData_Build\\";
	tcpServerConnection = new QTcpSocket;
	if (!tcpServerConnection->setSocketDescriptor(socketDescriptor)) {
		emit error(tcpServerConnection->error());
		return;
	}
	connect(tcpServerConnection, SIGNAL(readyRead()), this, SLOT(receiveData()),Qt::DirectConnection);
	connect(tcpServerConnection, SIGNAL(error(QAbstractSocket::SocketError)), this,SLOT(displayError(QAbstractSocket::SocketError)), Qt::DirectConnection); 
	connect(tcpServerConnection, SIGNAL(connectionClosed()), this, SLOT(connectError()), Qt::DirectConnection);
	exec();
}
开发者ID:cm8295,项目名称:server,代码行数:28,代码来源:tcpthread.cpp


示例8: Q_ASSERT

int QHttpConnection::HeadersComplete(http_parser *parser)
{
    QHttpConnection *theConnection = (QHttpConnection *)parser->data;
    Q_ASSERT(theConnection->m_request);

    /** set method **/
    theConnection->m_request->setMethod(static_cast<QHttpRequest::HttpMethod>(parser->method));

    /** set version **/
    theConnection->m_request->setVersion(QString("%1.%2").arg(parser->http_major).arg(parser->http_minor));

    // Insert last remaining header
    theConnection->m_currentHeaders[theConnection->m_currentHeaderField.toLower()] = theConnection->m_currentHeaderValue;
    theConnection->m_request->setHeaders(theConnection->m_currentHeaders);

    /** set client information **/
    theConnection->m_request->m_remoteAddress = theConnection->m_socket->peerAddress().toString();
    theConnection->m_request->m_remotePort = theConnection->m_socket->peerPort();

    QHttpResponse *response = new QHttpResponse(theConnection);
    if( parser->http_major < 1 || parser->http_minor < 1 )
        response->m_keepAlive = false;

    connect(theConnection, SIGNAL(destroyed()), response, SLOT(connectionClosed()));

    // we are good to go!
    Q_EMIT theConnection->newRequest(theConnection->m_request, response);
    return 0;
}
开发者ID:2015yc,项目名称:keepassx,代码行数:29,代码来源:qhttpconnection.cpp


示例9: while

void PollServerThread::run()
{
    extern volatile bool gPhoneScreenSyncOn;
    while ( !m_exit && gPhoneScreenSyncOn ) {
        if ( !connecting() ) {
            int n = WaitForMessage(m_rfbClient, 500);
            if ( n < 0 ) {
                m_exit = true;
                break;
            } else if ( n > 0 ) {
                emit messageArrived();
                m_lastMessageReceivedTimer.start();
            } else if ( checkConnection() ) {
                if ( ((ConnectionWindow *)parent())->connected() && m_lastMessageReceivedTimer.elapsed() > QVNCVIEWER_CONNPEND_TIMEOUT ) {
                    setCheckConnection(false);
                    m_rfbClient->updateRect.x = m_rfbClient->updateRect.y = 0;
                    m_rfbClient->updateRect.w = m_rfbClient->width;
                    m_rfbClient->updateRect.h = m_rfbClient->height;
                    SendIncrementalFramebufferUpdateRequest(m_rfbClient);
                }
            }
            QTest::qWait(0);
        } else  if ( connecting() ) {
            setCheckConnection(true);
            qApp->processEvents(QEventLoop::AllEvents, 10);
        }
    }

    emit connectionClosed();
}
开发者ID:SmartisanTech,项目名称:Wrench,代码行数:30,代码来源:connectionwindow.cpp


示例10: disconnect

void TestabilityService::sendRegisterMessage()
{  
    disconnect(mServerConnection, SIGNAL(connected()), this, SLOT(sendRegisterMessage()));

    QMap<QString, QString> attrs;
    attrs[PLUGIN_ID] = mPluginId;
    attrs[PLUGIN_NAME] = TestabilityUtils::getApplicationName();
    attrs[PLUGIN_TYPE] = TAS_PLUGIN;
#ifdef Q_OS_SYMBIAN
    quintptr uid = CEikonEnv::Static()->EikAppUi()->Application()->AppDllUid().iUid;
    attrs[APP_UID] = QString::number(uid);
#endif        
    QString message = makeReqisterMessage(COMMAND_REGISTER, attrs);

    mSocket->setResponseHandler(this);

    TasLogger::logger()->info("TestabilityService::reqisterServicePlugin send register message."); 
    mMessageId++;
    if(!mSocket->sendRequest(mMessageId, message)){
        TasLogger::logger()->error("TestabilityService::reqisterServicePlugin registering failed"); 
        mRegisterTime.stop();
        mSocket->closeConnection();
        connectionClosed();
    }
}
开发者ID:alirezaarmn,项目名称:cutedriver-agent_qt,代码行数:25,代码来源:testabilityservice.cpp


示例11: path

/*!
    Constructs an assistant client object. The \a path specifies the
    path to the Qt Assistant executable. If \a path is an empty
    string the system path (\c{%PATH%} or \c $PATH) is used.

    The assistant client object is a child of \a parent and is called
    \a name.
*/
QAssistantClient::QAssistantClient( const QString &path, QObject *parent, const char *name )
    : QObject( parent, name ), host ( "localhost" )
{
    if ( path.isEmpty() )
	assistantCommand = "assistant";
    else {
	QFileInfo fi( path );
	if ( fi.isDir() )
	    assistantCommand = path + "/assistant";
	else
	    assistantCommand = path;
    }

#if defined(Q_OS_MACX)
    assistantCommand += ".app/Contents/MacOS/assistant";
#elif defined(Q_WS_WIN)
    if (!assistantCommand.endsWith(".exe"))
        assistantCommand += ".exe";
#endif
    socket = new QSocket( this );
    connect( socket, SIGNAL( connected() ),
	    SLOT( socketConnected() ) );
    connect( socket, SIGNAL( connectionClosed() ),
	    SLOT( socketConnectionClosed() ) );
    connect( socket, SIGNAL( error( int ) ),
	    SLOT( socketError( int ) ) );
    opened = FALSE;
    proc = new QProcess( this );
    port = 0;
    pageBuffer = "";
    connect( proc, SIGNAL( readyReadStderr() ),
	     this, SLOT( readStdError() ) );
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:41,代码来源:qassistantclient.cpp


示例12: headerSize

void ServerWorker::_processMessages()
{
    const qint64 headerSize( MessageHeader::serializedSize );

    if( _tcpSocket->bytesAvailable() >= headerSize )
        _receiveMessage();

    // Send all events
    foreach( const Event& evt, _events )
        _send( evt );
    _events.clear();

    _tcpSocket->flush();

    // Finish reading messages from the socket if connection closed
    if( _tcpSocket->state() != QAbstractSocket::ConnectedState )
    {
        while( _tcpSocket->bytesAvailable() >= headerSize )
            _receiveMessage();

        emit( connectionClosed( ));
    }
    else if( _tcpSocket->bytesAvailable() >= headerSize )
        emit _dataAvailable();
}
开发者ID:hernando,项目名称:Deflect,代码行数:25,代码来源:ServerWorker.cpp


示例13: Q3Socket

//------------------------------------------------------------------------------
My3Socket::My3Socket(QObject *parent)
    : Q3Socket(parent), safeShutDown(false)
{
    connect(this, SIGNAL(readyRead()), this, SLOT(read()));
    connect(this, SIGNAL(delayedCloseFinished()), this, SLOT(closed()));
    connect(this, SIGNAL(connectionClosed()), this, SLOT(closed()));
}
开发者ID:tsuibin,项目名称:emscripten-qt,代码行数:8,代码来源:Test.cpp


示例14: assert

// Accept connection from server and initiate the SSL handshake
void Server::acceptConnection()
{
	if (sockets.empty() == false)
		std::cout << "Server is mad efor 1 connection also. Need to update to handle multiple connections" << std::endl;

  QSslSocket *socket = dynamic_cast<QSslSocket *>(server.nextPendingConnection());
  assert(socket);


  // Report any SSL errors that occur
  connect(socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));

  connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectionFailure()));

  
  // QSslSocket emits the encrypted() signal after the encrypted connection is established
#define _USE_ENCRYPTION
#ifdef _USE_ENCRYPTION
  connect(socket, SIGNAL(encrypted()), this, SLOT(handshakeComplete()));
  socket->setPrivateKey(key);
  socket->setLocalCertificate(certificate);

  socket->setPeerVerifyMode(QSslSocket::VerifyNone);
  socket->startServerEncryption();
#else
  connect(socket, SIGNAL(disconnected()), this, SLOT(connectionClosed()));
  connect(socket, SIGNAL(readyRead()), this, SLOT(receiveMessage()));
  sockets.push_back(socket);
  std::cout << "Accepted connection from " << socket->peerAddress().toString().toStdString() << ":" << socket->peerPort() << " .Encrypted : " << socket->isEncrypted() << std::endl;
#endif
}
开发者ID:Tudi,项目名称:TempStorage,代码行数:32,代码来源:server.cpp


示例15: connect

void Server::connectionHandler()
{
    m_clientConnection = m_server.nextPendingConnection();
    connect(m_clientConnection, SIGNAL(disconnected()), this, SLOT(connectionClosed()), Qt::DirectConnection);

    m_voipData->setServerConnected(true);
    clientConnectionChanged();
}
开发者ID:markg85,项目名称:uVoip,代码行数:8,代码来源:server.cpp


示例16: QSocket

void BServerSocket::newConnection( int socket )
{
	QSocket *s = new QSocket(this);
	connect(s,SIGNAL(readyRead()),this,SLOT(onReadyRead()));
	connect(s,SIGNAL(connectionClosed()),this,SLOT(onConnectionClosed()));
	s->setSocket(socket);

}
开发者ID:BackupTheBerlios,项目名称:freebilling-svn,代码行数:8,代码来源:bserversocket.cpp


示例17: QSocket

Qip::Qip()
{
    state = Start;
    socket = new QSocket( this );
    connect( socket, SIGNAL(connected()), SLOT(socketConnected()) );
    connect( socket, SIGNAL(connectionClosed()), SLOT(socketConnectionClosed()) );
    connect( socket, SIGNAL(readyRead()), SLOT(socketReadyRead()) );
    connect( socket, SIGNAL(error(int)), SLOT(socketError(int)) );
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:9,代码来源:qip.cpp


示例18: connectionClosed

void SerialPort::close()
{
    if(serial->isOpen())
    {
        timer->stop();
        serial->close();
        emit connectionClosed();
    }
}
开发者ID:rCorvidae,项目名称:StepperAndDcController,代码行数:9,代码来源:serialport.cpp


示例19: connectionClosed

void FQTermLocalSocket::connectToHost( const QString &host, quint16 port )
{
  if (local_shell_bin!=NULL) {
    shell_process_->start(local_shell_bin->arg(QString::number(port), host),
                          QIODevice::ReadWrite | QIODevice::Unbuffered);
  } else {
    emit connectionClosed();
  }
}
开发者ID:mytbk,项目名称:fqterm,代码行数:9,代码来源:fqterm_local_socket.cpp


示例20: resetConnection

void SocksClient::sock_connectionClosed()
{
    if(isOpen()) {
        resetConnection();
        emit connectionClosed();
    }
    else {
        setError(ErrProxyNeg);
    }
}
开发者ID:psi-im,项目名称:iris,代码行数:10,代码来源:socks.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ connectionGetCmTask函数代码示例发布时间:2022-05-30
下一篇:
C++ connection函数代码示例发布时间: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