Changeset 10960 in ntrip for trunk/BNC/src/bncnetqueryv2.cpp
- Timestamp:
- Jul 27, 2026, 1:43:45 PM (4 days ago)
- File:
-
- 1 edited
-
trunk/BNC/src/bncnetqueryv2.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncnetqueryv2.cpp
r10802 r10960 16 16 17 17 #include <iostream> 18 19 #include <QTimer> 18 20 19 21 #include "bncnetqueryv2.h" … … 34 36 _firstData = true; 35 37 _status = init; 38 _timeOut = 20000; 36 39 37 40 bncSettings settings; … … 215 218 // Wait Loop 216 219 // --------- 220 bool timedOut = false; 217 221 if (!_reply->bytesAvailable()) { 222 QTimer timer; 223 timer.setSingleShot(true); 224 connect(&timer, SIGNAL(timeout()), _eventLoop, SLOT(quit())); 225 timer.start(_timeOut); 218 226 _eventLoop->exec(); 227 timedOut = !timer.isActive(); 219 228 } 220 229 if (!_reply) { 230 return; 231 } 232 233 // Timeout: neither new data arrived nor did the request finish 234 // (e.g. connection silently dropped by a NAT/firewall) 235 // -------------------------------------------------------------- 236 if (timedOut) { 237 _status = error; 238 emit newMessage(_url.path().toLatin1().replace(0,1,"") 239 + ": Read timeout", true); 240 disconnect(_reply, SIGNAL(finished()), this, SLOT(slotFinished())); 241 _reply->abort(); 221 242 return; 222 243 }
Note:
See TracChangeset
for help on using the changeset viewer.
