Esempio n. 1
0
void SingleServer::startServer()
{
	if (!server->listen("cueplayer")) {
			 qDebug() << tr("CuePlayer Server") << trUtf8("Ошибка запуска сервера: %1.").arg(server->errorString());
			 QLocalServer::removeServer("cueplayer");
			 return;
	}
	connect(server, SIGNAL(newConnection()), this, SLOT(newConn()));
}
    vrpn_ConnectionPtr
    VRPNConnectionCollection::getConnection(std::string const &device,
                                            std::string const &host) {
        auto connMap = *m_connMap;
        auto existing = connMap.find(host);
        if (existing != end(connMap)) {
            return existing->second;
        }
        auto fullName = device + "@" + host;

        vrpn_ConnectionPtr newConn(
            vrpn_get_connection_by_name(fullName.c_str(), nullptr, nullptr,
                                        nullptr, nullptr, nullptr, true));
        connMap[host] = newConn;
        newConn->removeReference(); // Remove extra reference.
        return newConn;
    }