Exemplo n.º 1
0
bool NetClient::listen()
{
    if (!m_bConnected)
        return false;

    listenHost(m_pClient);
    listenHost(m_pHost);

    return true;
}
Exemplo n.º 2
0
std::string RhrController::getConfigString() const {

    std::stringstream config;
    if (connectionMethod() == RhrController::Connect) {
        auto host = listenHost();
        unsigned short port = listenPort();
        config << "connect " << host << " " << port;
    } else if (connectionMethod() == RhrController::Listen) {
        auto host = connectHost();
        unsigned short port = connectPort();
        if (port > 0) {
            config << "listen " << host << " " << port;
        } else {
            int id = m_module->id();
            config << "listen " << "_" << " " << ":" << id;
        }
    }

    return config.str();
}