Changeset 1368 in ntrip for trunk/BNC/bncgetthread.cpp
- Timestamp:
- Dec 27, 2008, 11:42:31 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncgetthread.cpp
r1367 r1368 503 503 _socket->waitForReadyRead(_timeOut); 504 504 nBytes = _socket->bytesAvailable(); 505 cout << "nBytes " << nBytes << endl; 505 506 } 506 507 else if (_rawInpFile) { … … 512 513 emit newBytes(_staID, nBytes); 513 514 514 char* data = new char[nBytes];515 QByteArray data; 515 516 516 517 if (_socket) { 517 _socket->read(data,nBytes);518 data = _socket->read(nBytes); 518 519 } 519 520 else if (_rawInpFile) { 520 nBytes = _rawInpFile->read(data,nBytes);521 if ( nBytes <= 0) {521 data = _rawInpFile->read(nBytes); 522 if (data.isEmpty()) { 522 523 cout << "no more data" << endl; 523 524 ::exit(0); … … 526 527 527 528 if (_rawOutFile) { 528 _rawOutFile->write(data , nBytes);529 _rawOutFile->write(data); 529 530 _rawOutFile->flush(); 530 531 } 531 532 532 533 if (_serialPort) { 533 _serialPort->write(data , nBytes);534 _serialPort->write(data); 534 535 //// _serialPort->flush(); 535 536 } … … 537 538 if (_inspSegm<1) { 538 539 vector<string> errmsg; 539 _decoder->Decode(data , nBytes, errmsg);540 _decoder->Decode(data.data(), data.size(), errmsg); 540 541 #ifdef DEBUG_RTCM2_2021 541 542 for (unsigned ii = 0; ii < errmsg.size(); ii++) { … … 553 554 if (decode) { 554 555 vector<string> errmsg; 555 if ( _decoder->Decode(data , nBytes, errmsg) == success ) {556 if ( _decoder->Decode(data.data(), data.size(), errmsg) == success ) { 556 557 numSucc += 1; 557 558 } … … 648 649 } 649 650 650 delete [] data;651 652 653 651 // RTCM scan output 654 652 // ----------------
Note:
See TracChangeset
for help on using the changeset viewer.