- Timestamp:
- Apr 15, 2008, 10:24:31 AM (17 years ago)
- Location:
- trunk/BNS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bns.cpp
r828 r829 74 74 } 75 75 } 76 77 openCaster(); 76 78 } 77 79 … … 216 218 if (_clkSocket && _clkSocket->state() == QAbstractSocket::ConnectedState) { 217 219 if ( _clkSocket->canReadLine()) { 218 if (_outSocket == 0) {219 openCaster();220 }221 220 readEpoch(); 222 221 } -
trunk/BNS/bnseph.cpp
r817 r829 26 26 //////////////////////////////////////////////////////////////////////////// 27 27 t_bnseph::t_bnseph(QObject* parent) : QThread(parent) { 28 _socket = 0; 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 } 29 40 } 30 41 … … 41 52 emit(newMessage("bnseph::run Start")); 42 53 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 } 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); 68 64 } 69 65 }
Note:
See TracChangeset
for help on using the changeset viewer.