Changeset 830 in ntrip
- Timestamp:
- Apr 15, 2008, 10:36:05 AM (17 years ago)
- Location:
- trunk/BNS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bns.cpp
r829 r830 74 74 } 75 75 } 76 77 openCaster();78 76 } 79 77 … … 218 216 if (_clkSocket && _clkSocket->state() == QAbstractSocket::ConnectedState) { 219 217 if ( _clkSocket->canReadLine()) { 218 if (_outSocket == 0) { 219 openCaster(); 220 } 220 221 readEpoch(); 221 222 } -
trunk/BNS/bnseph.cpp
r829 r830 26 26 //////////////////////////////////////////////////////////////////////////// 27 27 t_bnseph::t_bnseph(QObject* parent) : QThread(parent) { 28 29 QSettings settings; 30 QString host = "localhost"; 31 int port = settings.value("ephPort").toInt(); 32 33 _socket = new QTcpSocket(); 34 _socket->connectToHost(host, port); 35 36 const int timeOut = 3*1000; // 3 seconds 37 if (!_socket->waitForConnected(timeOut)) { 38 emit(error("bnseph::run Connect Timeout")); 39 } 28 _socket = 0; 40 29 } 41 30 … … 52 41 emit(newMessage("bnseph::run Start")); 53 42 54 while (true) { 55 if (_socket->state() != QAbstractSocket::ConnectedState) { 56 emit(error("bnseph::not connected")); 57 break; 58 } 59 if (_socket->canReadLine()) { 60 readEph(); 61 } 62 else { 63 _socket->waitForReadyRead(10); 43 // Connect the Socket 44 // ------------------ 45 QSettings settings; 46 QString host = "localhost"; 47 int port = settings.value("ephPort").toInt(); 48 49 _socket = new QTcpSocket(); 50 _socket->connectToHost(host, port); 51 52 const int timeOut = 3*1000; // 3 seconds 53 if (!_socket->waitForConnected(timeOut)) { 54 emit(error("bnseph::run Connect Timeout")); 55 } 56 else { 57 while (true) { 58 if (_socket->state() != QAbstractSocket::ConnectedState) { 59 emit(error("bnseph::not connected")); 60 break; 61 } 62 if (_socket->canReadLine()) { 63 readEph(); 64 } 65 else { 66 _socket->waitForReadyRead(10); 67 } 64 68 } 65 69 }
Note:
See TracChangeset
for help on using the changeset viewer.