void CulistGui::connectToTcpServer() { if (_tcpConnection ) delete _tcpConnection; _tcpConnection = new QTcpSocket(this); _tcpConnection ->connectToHost( ui->eClientModeSrvAddr->text(), ui->eClientModeSrvPort->text().toUShort() ); connect(_tcpConnection,SIGNAL(connected()), this, SLOT(onConnnected())); connect(_tcpConnection,SIGNAL(readyRead()), this, SLOT(onDataRead())); connect(_tcpConnection,SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onError(QAbstractSocket::SocketError))); }
void XMPPLayer::handleDataRead(const ByteArray& data) { onDataRead(data); inParser_ = true; if (!xmppParser_->parse(data.toString())) { inParser_ = false; onError(); return; } inParser_ = false; if (resetParserAfterParse_) { doResetParser(); } }
void XMPPLayer::handleDataRead(const SafeByteArray& data) { onDataRead(data); inParser_ = true; // FIXME: Converting to unsafe string. Should be ok, since we don't take passwords // from the stream in clients. If servers start using this, and require safe storage, // we need to fix this. if (!xmppParser_->parse(byteArrayToString(ByteArray(data.begin(), data.end())))) { inParser_ = false; onError(); return; } inParser_ = false; if (resetParserAfterParse_) { doResetParser(); } }
void Connection::startAsyncRead() { client_socket_->async_read_some(boost::asio::buffer(buff_), [this](const boost::system::error_code& e, std::size_t size)->void { if (e) { BOOST_LOG_TRIVIAL(error) << e.message(); } else { onDataRead(size); if (client_socket_->is_open()) startAsyncRead(); } }); }
void BOSHSessionStream::handlePoolBOSHDataRead(const SafeByteArray& data) { onDataRead(data); }
void CoreClient::handleDataRead(const SafeByteArray& data) { onDataRead(data); }
void Server::handleDataRead(const SafeByteArray& data) { onDataRead(data); }
void TLSConnection::handleTLSDataForApplication(const SafeByteArray& data) { onDataRead(std::make_shared<SafeByteArray>(data)); }