Ejemplo n.º 1
0
AsyncDNS::AsyncDNS(QHostAddress host, quint16 port, QObject *parent) : QObject(parent)
{
    socket = new QUdpSocket(this);
    DNS_server = host;
    DNS_port   = port;

    socket->bind(DNS_port);

    connect(socket, SIGNAL(readyRead()) , this, SLOT(handleReadData()) );
    connect(this, SIGNAL(resolve(QString)), this, SLOT(onResolve(QString)) );
}
Ejemplo n.º 2
0
RECEIVE_SRPC_METHOD_1(NamingServiceServer, resolve,
    srpc::RString, name)
{
    bool exists = false;
    srpc::RString value;
    NameValues::iterator pos = nameValues_.find(name);
    if (pos != nameValues_.end()) {
        value = (*pos).second;
        exists = true;
    }
    onResolve(name, value, exists);
}