Changeset 1368 in ntrip for trunk/BNC/bncgetthread.cpp


Ignore:
Timestamp:
Dec 27, 2008, 11:42:31 PM (15 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncgetthread.cpp

    r1367 r1368  
    503503        _socket->waitForReadyRead(_timeOut);
    504504        nBytes = _socket->bytesAvailable();
     505        cout << "nBytes " << nBytes << endl;
    505506      }
    506507      else if (_rawInpFile) {
     
    512513        emit newBytes(_staID, nBytes);
    513514
    514         char* data = new char[nBytes];
     515        QByteArray data;
    515516
    516517        if (_socket) {
    517           _socket->read(data, nBytes);
     518          data = _socket->read(nBytes);
    518519        }
    519520        else if (_rawInpFile) {
    520           nBytes = _rawInpFile->read(data, nBytes);
    521           if (nBytes <= 0) {
     521          data = _rawInpFile->read(nBytes);
     522          if (data.isEmpty()) {
    522523            cout << "no more data" << endl;
    523524            ::exit(0);
     
    526527
    527528        if (_rawOutFile) {
    528           _rawOutFile->write(data, nBytes);
     529          _rawOutFile->write(data);
    529530          _rawOutFile->flush();
    530531        }
    531532
    532533        if (_serialPort) {
    533           _serialPort->write(data, nBytes);
     534          _serialPort->write(data);
    534535          ////          _serialPort->flush();
    535536        }
     
    537538        if (_inspSegm<1) {
    538539          vector<string> errmsg;
    539           _decoder->Decode(data, nBytes, errmsg);
     540          _decoder->Decode(data.data(), data.size(), errmsg);
    540541#ifdef DEBUG_RTCM2_2021
    541542          for (unsigned ii = 0; ii < errmsg.size(); ii++) {
     
    553554            if (decode) {
    554555              vector<string> errmsg;
    555               if ( _decoder->Decode(data, nBytes, errmsg) == success ) {
     556              if ( _decoder->Decode(data.data(), data.size(), errmsg) == success ) {
    556557                numSucc += 1;
    557558              }
     
    648649        }
    649650
    650         delete [] data;
    651 
    652        
    653651        // RTCM scan output
    654652        // ----------------
Note: See TracChangeset for help on using the changeset viewer.