Пример #1
0
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)));
}
Пример #2
0
void XMPPLayer::handleDataRead(const ByteArray& data) {
	onDataRead(data);
	inParser_ = true;
	if (!xmppParser_->parse(data.toString())) {
		inParser_ = false;
		onError();
		return;
	}
	inParser_ = false;
	if (resetParserAfterParse_) {
		doResetParser();
	}
}
Пример #3
0
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();
	}
}
Пример #4
0
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();
        }
    });
}
Пример #5
0
void BOSHSessionStream::handlePoolBOSHDataRead(const SafeByteArray& data) {
    onDataRead(data);
}
Пример #6
0
void CoreClient::handleDataRead(const SafeByteArray& data) {
	onDataRead(data);
}
Пример #7
0
void Server::handleDataRead(const SafeByteArray& data) {
	onDataRead(data);
}
Пример #8
0
void TLSConnection::handleTLSDataForApplication(const SafeByteArray& data) {
    onDataRead(std::make_shared<SafeByteArray>(data));
}