void CServer::sendProc() { TS_PEER_MESSAGE pmsg; memset(&pmsg, 0, sizeof(TS_PEER_MESSAGE)); CPeerConnection* peer = new CPeerConnection(pConnect->getSocket()); while (isRunning()) { ReadOut(pmsg); peer->setPeer(pmsg.peeraddr); peer->send(pmsg.msg.Body, packetSize(pmsg.msg)); #ifdef _DEBUG_INFO_ // cout << "port:" << pConnect->getPeer()->sin_port << endl; #endif } delete peer; }
void MainWindow::bash(QString command) { QProcess *p = new QProcess( this ); if (p) { p->setEnvironment( QProcess::systemEnvironment() ); p->setProcessChannelMode( QProcess::MergedChannels ); p->start( command ); p->waitForStarted(); connect( p, SIGNAL(readyReadStandardOutput()), this, SLOT(ReadOut()) ); connect( p, SIGNAL(readyReadStandardError()), this, SLOT(ReadErr()) ); } }
void CClientNet::sendProc() { TS_PEER_MESSAGE *pmsg = new TS_PEER_MESSAGE(); memset(pmsg, 0, sizeof(TS_PEER_MESSAGE)); iop_usleep(10); while (isRunning()) { ReadOut(*pmsg); if (getType(pmsg->msg) > PACKETCONTROL) m_agent->send(pmsg->msg.Body, packetSize(pmsg->msg)); else m_Connect->send(pmsg->msg.Body, packetSize(pmsg->msg)); } delete pmsg; #ifdef _DEBUG_INFO_ cout << "send thread exit" << endl; #endif }