Changeset 1418 in ntrip


Ignore:
Timestamp:
Dec 31, 2008, 2:46:05 PM (15 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncnetqueryrtp.cpp

    r1417 r1418  
    113113      passW.toAscii()).toBase64() + "\r\n";
    114114    }
     115
     116    // Find a free port number
     117    // -----------------------
     118    int clientPortInt = 0;
     119    QTcpSocket* hlpSocket = new QTcpSocket();
     120    if ( proxyHost.isEmpty() ) {
     121      hlpSocket->connectToHost(urlLoc.host(), urlLoc.port());
     122    }
     123    else {
     124      hlpSocket->connectToHost(proxyHost, proxyPort);
     125    }
     126    if (hlpSocket->waitForConnected(timeOut)) {
     127      clientPortInt = hlpSocket->localPort();
     128    }
     129    delete hlpSocket;
    115130   
    116     QByteArray clientPort = "7777"; // TODO: make it an option
     131    QByteArray clientPort = QString("%1").arg(clientPortInt).toAscii();
    117132    delete _udpSocket;
    118133    _udpSocket = new QUdpSocket();
    119     _udpSocket->bind(clientPort.toInt());
     134    _udpSocket->bind(clientPortInt);
    120135    connect(_udpSocket, SIGNAL(readyRead()), _eventLoop, SLOT(quit()));
    121136   
Note: See TracChangeset for help on using the changeset viewer.