Changeset 2645 in ntrip
- Timestamp:
- Nov 5, 2010, 8:25:05 AM (14 years ago)
- Location:
- trunk/BNS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bnscaster.cpp
r2643 r2645 93 93 // Start the Communication with NTRIP Caster 94 94 //////////////////////////////////////////////////////////////////////////// 95 void t_bnscaster::open( bool force) {95 void t_bnscaster::open() { 96 96 97 97 if (_mountpoint.isEmpty()) { … … 99 99 } 100 100 101 if (_outSocket != 0) { 102 if ( _outSocket->state() == QAbstractSocket::HostLookupState || 103 _outSocket->state() == QAbstractSocket::ConnectingState || 104 _outSocket->state() == QAbstractSocket::ConnectedState ) { 105 return; 106 } 101 if (_outSocket != 0 && 102 _outSocket->state() == QAbstractSocket::ConnectedState) { 103 return; 107 104 } 108 105 … … 113 110 _sOpenTrial = 4; 114 111 } 115 if (!force && 116 _outSocketOpenTime.isValid() && 112 if (_outSocketOpenTime.isValid() && 117 113 _outSocketOpenTime.secsTo(QDateTime::currentDateTime()) < minDt) { 118 114 return; … … 221 217 //////////////////////////////////////////////////////////////////////////// 222 218 void t_bnscaster::write(char* buffer, unsigned len) { 223 for (int iTrial = 1; iTrial <= 2; ++iTrial) { 224 if (_outSocket) { 225 unsigned bytesWritten = _outSocket->write(buffer, len); 226 if (bytesWritten == len) { 227 _outSocket->flush(); 228 break; 229 } 230 else { 231 emit(newMessage("Broadcaster: cannot write to socket, closing")); 232 delete _outSocket; 233 _outSocket = 0; 234 open(true); 235 } 236 } 219 if (_outSocket) { 220 _outSocket->write(buffer, len); 221 _outSocket->flush(); 237 222 } 238 223 } -
trunk/BNS/bnscaster.h
r2643 r2645 10 10 t_bnscaster(const QString& mountpoint); 11 11 virtual ~t_bnscaster(); 12 void open( bool force = false);12 void open(); 13 13 void write(char* buffer, unsigned len); 14 14 void printAscii(const QString& line); -
trunk/BNS/bnseph.cpp
r2644 r2645 90 90 const int timeOut = 30*1000; // 30 seconds 91 91 if (!_socket->waitForConnected(timeOut)) { 92 emit(newMessage("bnseph::reconnect: Connect Timeout")); 92 // emit(newMessage("bnseph::run Connect Timeout")); 93 emit(newMessage("Ephemeris server: Connection timeout")); // weber 93 94 msleep(1000); 94 95 } … … 99 100 void t_bnseph::run() { 100 101 101 emit(newMessage("bnseph::run: Start")); 102 //emit(newMessage("bnseph::run Start")); 103 emit(newMessage("Ephemeris server: Connection opened")); // weber 102 104 103 105 while (true) { 104 106 if ( _socket == 0 || 105 (_socket->state() != QAbstractSocket::HostLookupState && 106 _socket->state() != QAbstractSocket::ConnectingState && 107 (_socket->state() != QAbstractSocket::ConnectingState && 107 108 _socket->state() != QAbstractSocket::ConnectedState) ) { 108 109 reconnect();
Note:
See TracChangeset
for help on using the changeset viewer.