void SingleIRCNetworkPlugin::readData() { size_t availableBytes = m_socket->bytesAvailable(); if (availableBytes == 0) return; std::string d = std::string(m_socket->readAll().data(), availableBytes); handleDataRead(d); }
void IRCNetworkPlugin::readData() { size_t availableBytes = m_socket->bytesAvailable(); if (availableBytes == 0) return; if (m_firstPing) { m_firstPing = false; NetworkPlugin::PluginConfig cfg; cfg.setNeedRegistration(false); cfg.setSupportMUC(true); cfg.disableJIDEscaping(); sendConfig(cfg); } std::string d = std::string(m_socket->readAll().data(), availableBytes); handleDataRead(d); }
void BaseConnection::handleRead(EventLoop::Status status) { CHECK(status == EventLoop::READ_EVENT); mReadState = READY; sp_int32 readStatus = readFromEndPoint(mEndpoint->get_fd()); if (readStatus >= 0) { mReadState = NOTREADY; } else { mReadState = ERROR; mState = TO_BE_DISCONNECTED; } bool prevValue = mCanCloseConnection; mCanCloseConnection = false; handleDataRead(); mCanCloseConnection = prevValue; if (mState != CONNECTED) { internalClose(); } }
void BOSHConnection::handleTLSApplicationDataRead(const SafeByteArray& data) { SWIFT_LOG(debug) << std::endl; handleDataRead(std::make_shared<SafeByteArray>(data)); }