Changeset 1791 in ntrip
- Timestamp:
- Apr 9, 2009, 6:41:14 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNC/bncnetqueryudp0.cpp ¶
r1788 r1791 15 15 * -----------------------------------------------------------------------*/ 16 16 17 #include <iostream>18 19 17 #include "bncnetqueryudp0.h" 20 21 using namespace std;22 18 23 19 // Constructor … … 26 22 _udpSocket = 0; 27 23 _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 }34 24 } 35 25 … … 78 68 _status = running; 79 69 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()); 89 73 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())); 101 75 } 102 76
Note:
See TracChangeset
for help on using the changeset viewer.