Changeset 3210 in ntrip for trunk/BNC/upload
- Timestamp:
- Mar 31, 2011, 7:49:49 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/upload/bncuploadcaster.cpp
r3209 r3210 191 191 //////////////////////////////////////////////////////////////////////////// 192 192 void bncUploadCaster::deleteSafely() { 193 QMutexLocker locker(&_mutex);194 193 _isToBeDeleted = true; 195 194 if (!isRunning()) { … … 214 213 void bncUploadCaster::run() { 215 214 while (true) { 216 { 217 QMutexLocker locker(&_mutex); 218 if (_isToBeDeleted) { 219 QThread::quit(); 220 deleteLater(); 221 return; 222 } 223 } 215 if (_isToBeDeleted) { 216 QThread::quit(); 217 deleteLater(); 218 return; 219 } 220 open(); 224 221 uploadClockOrbitBias(); 225 222 msleep(10); … … 290 287 //////////////////////////////////////////////////////////////////////////// 291 288 void bncUploadCaster::write(char* buffer, unsigned len) { 292 if (_outSocket ) {289 if (_outSocket && _outSocket->state() == QAbstractSocket::ConnectedState) { 293 290 _outSocket->write(buffer, len); 294 291 _outSocket->flush(); … … 304 301 // Append to buffer 305 302 // ---------------- 303 const int MAXBUFFSIZE = 1000; 306 304 _rtnetStreamBuffer.append(QByteArray(buffer, bufLen)); 305 if (_rtnetStreamBuffer.size() > MAXBUFFSIZE) { 306 _rtnetStreamBuffer = _rtnetStreamBuffer.right(MAXBUFFSIZE); 307 } 307 308 } 308 309 … … 322 323 for (int ii = 0; ii < hlpLines.size(); ii++) { 323 324 if (hlpLines[ii].indexOf('*') != -1) { 325 lines.clear(); 324 326 QTextStream in(hlpLines[ii].toAscii()); 325 327 QString hlp; … … 338 340 return; 339 341 } 340 341 this->open();342 342 343 343 unsigned year, month, day; … … 452 452 } 453 453 454 if ( _outSocket && (co.NumberOfGPSSat > 0 || co.NumberOfGLONASSSat > 0)) {454 if (co.NumberOfGPSSat > 0 || co.NumberOfGLONASSSat > 0) { 455 455 char obuffer[CLOCKORBIT_BUFFERSIZE]; 456 456 … … 461 461 } 462 462 463 if ( _outSocket && (bias.NumberOfGPSSat > 0 || bias.NumberOfGLONASSSat > 0)) {463 if (bias.NumberOfGPSSat > 0 || bias.NumberOfGLONASSSat > 0) { 464 464 char obuffer[CLOCKORBIT_BUFFERSIZE]; 465 465 int len = MakeBias(&bias, BTYPE_AUTO, 0, obuffer, sizeof(obuffer));
Note:
See TracChangeset
for help on using the changeset viewer.