Changeset 1791 in ntrip


Ignore:
Timestamp:
Apr 9, 2009, 6:41:14 AM (15 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncnetqueryudp0.cpp

    r1788 r1791  
    1515 * -----------------------------------------------------------------------*/
    1616
    17 #include <iostream>
    18 
    1917#include "bncnetqueryudp0.h"
    20 
    21 using namespace std;
    2218
    2319// Constructor
     
    2622  _udpSocket = 0;
    2723  _eventLoop = new QEventLoop(this);
    28 
    29   _keepAlive[ 0] = 128;
    30   _keepAlive[ 1] =  96;
    31   for (int ii = 2; ii <=11; ii++) {
    32     _keepAlive[ii] = 0;
    33   }
    3424}
    3525
     
    7868  _status = running;
    7969
    80   // Default scheme and path
    81   // -----------------------
    82   _url = url;
    83   if (_url.scheme().isEmpty()) {
    84     _url.setScheme("http");
    85   }
    86   if (_url.path().isEmpty()) {
    87     _url.setPath("/");
    88   }
     70  delete _udpSocket;
     71  _udpSocket = new QUdpSocket();
     72  _udpSocket->bind(_url.port());
    8973
    90   delete _udpSocket; _udpSocket = 0;
    91 
    92   QHostInfo hInfo = QHostInfo::fromName(_url.host());
    93   if (!hInfo.addresses().isEmpty()) {
    94     _address = hInfo.addresses().first();
    95     _udpSocket = new QUdpSocket();
    96     _udpSocket->bind(_url.port());
    97     connect(_udpSocket, SIGNAL(readyRead()), _eventLoop, SLOT(quit()));
    98 
    99     _udpSocket->writeDatagram(_keepAlive, 12, _address, _url.port());
    100   }
     74  connect(_udpSocket, SIGNAL(readyRead()), _eventLoop, SLOT(quit()));
    10175}
    10276
Note: See TracChangeset for help on using the changeset viewer.