void EWingInput::init() { /* Create a new UDP socket and start listening to packets coming to any local address. */ m_socket = new QUdpSocket(this); m_socket->bind(QHostAddress::Any, EWing::UDPPort); connect(m_socket, SIGNAL(readyRead()), this, SLOT(slotReadSocket())); }
void EnttecWing::init() { /* Create a new UDP socket and start listening to packets coming to any local address. */ m_socket = new QUdpSocket(this); reBindSocket(); connect(m_socket, SIGNAL(readyRead()), this, SLOT(slotReadSocket())); }
void NetworkServer::slotNewConnection() { QTcpSocket* socket = mTcpServer->nextPendingConnection(); qDebug() << "NetworkServer::slotNewConnection(): accepting connection from" << socket->peerName() << "and port" << socket->peerPort(); connect(socket, SIGNAL(disconnected()), SLOT(slotConnectionEnded())); connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(slotConnectionEnded())); connect(socket, SIGNAL(readyRead()), SLOT(slotReadSocket())); mTcpSockets.append(socket); }
int EWingInput::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QLCInPlugin::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: valueChanged((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< quint32(*)>(_a[2])),(*reinterpret_cast< uchar(*)>(_a[3]))); break; case 1: configurationChanged(); break; case 2: slotReadSocket(); break; case 3: slotValueChanged((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< uchar(*)>(_a[2]))); break; default: ; } _id -= 4; } return _id; }
void SocketApi::slotNewConnection() { QIODevice* socket = _localServer.nextPendingConnection(); if( ! socket ) { return; } DEBUG << "New connection" << socket; connect(socket, SIGNAL(readyRead()), this, SLOT(slotReadSocket())); connect(socket, SIGNAL(disconnected()), this, SLOT(onLostConnection())); Q_ASSERT(socket->readAll().isEmpty()); _listeners.append(socket); foreach( Folder *f, FolderMan::instance()->map() ) { QString message = buildRegisterPathMessage(f->path()); sendMessage(socket, message); }