void QuerySocket::setAutoRead( bool c ) { if( !c ) disconnect(this, SIGNAL( readyRead() ), this, SLOT( readServer() ) ); else connect(this, SIGNAL( readyRead() ), this, SLOT( readServer() ) ); autoRead = c; }
Server::Server() { connect(this, SIGNAL(readyRead()), this, SLOT(readServer())); connect(this, SIGNAL(connected()), this, SLOT(connected())); connect(this, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(errorSocket(QAbstractSocket::SocketError))); updateUsers=false; }
void consoleService() { char ch ; ch = readKey(); if ( ch < 1 ) { ch = readServer(); if (ch < 1) return; } if ( controlMode(ch) ) { p(" -> %02d:%02d:%02d ", getHours(), getMinutes(), getSeconds() ); } }
void SocketProxy::handleClientWrite(const boost::system::error_code& e, std::size_t bytesTransferred) { if (!e) { readServer(); } else { handleError(e, ERROR_LOCATION); } }
void TSession::initialization(){ echoMode = false; lastChar='\0'; outputData.clear(); terminalType.clear(); memset(optionsState,CONST_OFF,sizeof(optionsState)); for(int i=0;i<40;i++) optionsState[i] = CONST_OFF; optionsState[1]=OFF; optionsState[3]=CONST_ON; connect(this,SIGNAL(readyRead()),this,SLOT(readServer())); connect(this,SIGNAL(connected()),this,SLOT(connectToServerSlot())); }
QuerySocket::QuerySocket(QObject *parent) : QTcpSocket(parent) { data = ""; error = ""; MagicNumber = 0x194FF881; nextBlockSize = 0; dataRead = false; autoRead = true; connect(this, SIGNAL( readyRead() ), this, SLOT( readServer() ) ); connect(this, SIGNAL( error(QAbstractSocket::SocketError) ), this, SLOT( setError() ) ); connect(this, SIGNAL( connected() ), this, SLOT( sendRequest() ) ); connect(this, SIGNAL( disconnected() ), this, SLOT( closeConnection() ) ); }
void ServerW::checkFds() { int i; i = 0; while (i < MAX_FD) { if (FD_ISSET(i, &_fdRead)) if (_fdType[i] == FD_SERVER) readServer(); else readClient(i); ++i; } }
void RcUnitWidget::updateRcUnits() { ui->units->clear(); QMap<QString, QTreeWidgetItem*> roots = readServer(); foreach(QString unit, HilecSingleton::hilec()->rcUnits()) { const RcUnitHelp& help = HilecSingleton::hilec()->getUnitHelp(unit); if(!roots.contains(help.server)) roots[help.server] = new QTreeWidgetItem(ui->units, QStringList(help.server)); QTreeWidgetItem* item = new QTreeWidgetItem(roots[help.server], QStringList(unit)); item->setIcon(0, QIcon(":hilecGui/rcUnit.png")); if(help.type == BaseRcUnitType || help.hwConnected) item->setIcon(1, QIcon(":hilecGui/flag_green.png")); else item->setIcon(1, QIcon(":hilecGui/flag_yellow.png")); } ui->units->expandAll(); ui->units->resizeColumnToContents(0); ui->units->resizeColumnToContents(1); }
/*! * \fn int main(int argc, char **argv) * Fonction principale * \return Le code de fin d'execution de la main loop. */ int main (int argc,char **argv) { QApplication app(argc,argv); MainWindow *fen = new MainWindow(NULL); IIrcEngine *engine = NonNativeIrcEngine::engine(); QObject::connect(fen, SIGNAL(connectMe(const QString&, int, const QString&)), engine, SLOT(initiateConnection(const QString&, int, const QString&))); QObject::connect(engine, SIGNAL(lineReceived(QString)), fen, SLOT(readServer(QString))); QObject::connect(fen, SIGNAL(sendASCIIMessage(const QString&)), engine, SLOT(sendASCIIMessage(const QString&))); /* La QMainWindow */ MainWindowView *mW = new MainWindowView(fen,NULL); mW->show(); XmlConfManager *confMan = XmlConfManager::confManager(); /*confMan->addServer("test"); confMan->addNetwork("test", confMan->createNetwork("irc.fansub-irc.eu", "6667")); confMan->changeUser("test", confMan->createUser("pierre", "pierreghost", "user", "real")); confMan->changeFavChan("test", "#fsf,#Kyubi-Wolf"); confMan->changeCommand("test", "/ns identify albachat"); confMan->save();*/ confMan->read(); ServerList *serverList = new ServerList(); QObject::connect(serverList, SIGNAL(connectSignal(QString&, int, QString&)), fen, SLOT(connexion(QString&, int, QString&))); QObject::connect(engine, SIGNAL(connectError()), serverList, SLOT(reconnect())); serverList->show(); return app.exec(); }
asynStatus mar345::waitForCompletion(const char *doneString, double timeout) { char response[MAX_MESSAGE_SIZE]; asynStatus status; double elapsedTime; epicsTimeStamp start, now; const char *functionName = "waitForCompletion"; epicsTimeGetCurrent(&start); while (1) { status = readServer(response, sizeof(response), MAR345_POLL_DELAY); if (status == asynSuccess) { if (strstr(response, doneString)) return(asynSuccess); } epicsTimeGetCurrent(&now); elapsedTime = epicsTimeDiffInSeconds(&now, &start); if (elapsedTime > timeout) { asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR, "%s:%s: error waiting for response from marServer\n", driverName, functionName); return(asynError); } } }
void RcUnitWidget::setProjectFile(const QString &projectFile) { mProjectFile = projectFile; readServer(); }