예제 #1
0
SIMResolver::SIMResolver(QObject *parent, const char *host)
        : QObject(parent)
{
    bDone = false;
    bTimeout = false;
#ifdef WIN32
    bool bState;
    if (get_connection_state(bState) && !bState){
        QTimer::singleShot(0, this, SLOT(resolveTimeout()));
        return;
    }
#endif
    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(resolveTimeout()));
    timer->start(20000);
    dns = new QDns(host, QDns::A);
    connect(dns, SIGNAL(resultsReady()), this, SLOT(resolveReady()));
}
예제 #2
0
SIMResolver::SIMResolver(QObject *parent, const char *host)
        : QObject(parent)
{
    bDone = false;
    bTimeout = false;
    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(resolveTimeout()));
    timer->start(20000);
    dns = new QDns(host, QDns::A);
    connect(dns, SIGNAL(resultsReady()), this, SLOT(resolveReady()));
}
예제 #3
0
void ICQClientSocket::connect(const char *host, int _port)
{
    port = _port;
    log(L_DEBUG, "Connect to %s:%u", host, port);
#ifdef HAVE_KEXTSOCK_H
    sock->setAddress(host, port);
    if (sock->lookup() < 0){
        log(L_WARN, "Can't lookup");
        if (notify) notify->error_state(ErrorConnect);
    }
    if (sock->startAsyncConnect() < 0){
        log(L_WARN, "Can't connect");
        if (notify) notify->error_state(ErrorConnect);
    }
#else
    bConnected = false;
    QTimer::singleShot(10000, this, SLOT(resolveTimeout()));
    sock->connectToHost(host, port);
#endif
}