static UInt8 sviMemRead(void* ref, UInt16 address) { if ((svi80ColEnabled && svi80colMemBankCtrlStatus()) && (address & 0xf800) == 0xf000) return svi80colMemRead(address & 0xfff); else return slotRead(ref, address); }
void ANetwork::newConnection() { //инициализируем сокет новым подключением tcpServerSocket = tcpServer.nextPendingConnection(); //подключаем сигнал о новых данных к функции их чтения и обработки connect(tcpServerSocket,SIGNAL(readyRead()),this, SLOT(slotRead())); }
void toEventQuery::start() { if ( Worker || Started || WorkDone ) throw tr("toEventQuery::start - can not restart already stared query"); Worker = new toEventQueryWorker(this, Connection, CancelCondition, SQL, Param); Worker->moveToThread(Thread); Thread->Slave = Worker; // Connect to Worker's API connect(Worker, SIGNAL(headers(toQColumnDescriptionList &, int)), // BG -> main this, SLOT(slotDesc(toQColumnDescriptionList &, int))); connect(Worker, SIGNAL(data(const ValuesList &)), // BG -> main this, SLOT(slotData(const ValuesList &))); connect(Worker, SIGNAL(error(const toConnection::exception &)), // BG -> main this, SLOT(slotError(const toConnection::exception &))); connect(Worker, SIGNAL(workDone()), // BG -> main this, SLOT(slotFinished())); connect(Worker, SIGNAL(rowsProcessed(unsigned long)), // BG -> main this, SLOT(slotRowsProcessed(unsigned long))); connect(this, SIGNAL(dataRequested()), Worker, SLOT(slotRead())); // main -> BG connect(this, SIGNAL(consumed()), Worker, SLOT(slotRead())); // main -> BG // Connect to QThread's API // error handling connect(Worker, SIGNAL(error(toConnection::exception const &)) // BG -> main , this, SLOT(slotError(toConnection::exception const &))); // initization connect(Thread, SIGNAL(started()), Worker, SLOT(init())); // main -> BG connect(Worker, SIGNAL(started()), this, SLOT(slotStarted()));// BG -> main // finish connect(Worker, SIGNAL(finished()), Thread, SLOT(quit())); // BG -> BG?? (quit event loop) connect(Worker, SIGNAL(finished()), Worker, SLOT(deleteLater())); // BG -> BG connect(Thread, SIGNAL(finished()), Thread, SLOT(deleteLater())); // BG -> main connect(Thread, SIGNAL(destroyed()), this, SLOT(slotThreadEnd())); // main -> main connect(this, SIGNAL(stopRequested()), Worker, SLOT(slotStop())); // main -> BG TLOG(7, toDecorator, __HERE__) << "toEventQuery start" << std::endl; // finally start the thread Thread->start(); }
Referee::Referee(int teamID, QObject *parent) : QObject(parent), messengerOfTheGods(new Hermes(this)), wLimit(1024), myTeamID(teamID), messageSize(0), connection( false), testMode(false), verbose(true), ready(false) { connect(messengerOfTheGods, SIGNAL(readyRead()), this, SLOT(slotRead())); connect(messengerOfTheGods, SIGNAL(connected()), this, SLOT(slotConnected())); connect(messengerOfTheGods, SIGNAL(disconnected()), this, SLOT(slotDisconnected())); }
droneNavData::droneNavData(droneControl * control_init) : QUdpSocket() { bind(5554,QUdpSocket::ShareAddress) ; control = control_init; QObject::connect(this,SIGNAL(readyRead()),this,SLOT(slotRead())) ; }
Widget::Widget( QWidget * parent ) : QWidget( parent ) { createWidgets(); setWindowTitle( tr("Echo client %1").arg( PORT ) ); connect( &socket, SIGNAL( connected() ), SLOT( slotConnected() ) ); connect( &socket, SIGNAL( disconnected() ), SLOT( slotDisconnected() ) ); connect( &socket, SIGNAL( readyRead() ), SLOT( slotRead() ) ); tcpConnect(); }
AtlantikNetwork::AtlantikNetwork(AtlanticCore *atlanticCore) : KExtendedSocket(0, 0, KExtendedSocket::inputBufferedSocket) { m_atlanticCore = atlanticCore; m_textStream = new QTextStream(this); m_textStream->setCodec(QTextCodec::codecForName("utf8")); m_playerId = -1; m_serverVersion = ""; QObject::connect(this, SIGNAL(readyRead()), this, SLOT(slotRead())); QObject::connect(this, SIGNAL(lookupFinished(int)), this, SLOT(slotLookupFinished(int))); QObject::connect(this, SIGNAL(connectionSuccess()), this, SLOT(slotConnectionSuccess())); QObject::connect(this, SIGNAL(connectionFailed(int)), this, SLOT(slotConnectionFailed(int))); }
void AtlantikNetwork::slotRead() { if ( socketStatus() != KExtendedSocket::connected ) return; if (canReadLine()) { processMsg(m_textStream->readLine()); // There might be more data QTimer::singleShot(0, this, SLOT(slotRead())); } else { // Maximum message size. Messages won't get bigger than 32k anyway, so // if we didn't receive a newline by now, we probably won't anyway. if (bytesAvailable() > (1024 * 32)) flush(); } }