Changeset 1386 in ntrip


Ignore:
Timestamp:
Dec 29, 2008, 10:12:29 AM (15 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncrinex.cpp

    r1376 r1386  
    5454#include "bnctabledlg.h"
    5555#include "bncgetthread.h"
    56 #include "bncsocket.h"
     56#include "bncnetqueryv2.h"
    5757#include "RTCM3/rtcm3torinex.h"
    5858
     
    154154    }
    155155
    156     const int timeOut = 10*1000;
    157     QString msg;
    158     QByteArray _latitude;
    159     QByteArray _longitude;
    160     QByteArray _nmea;
    161     bncSocket* socket = new bncSocket();
    162     if (socket->request(url, _latitude, _longitude,
    163                         _nmea, _ntripVersion, timeOut, msg) != success) {
    164       delete socket;
    165       return failure;
    166     }
    167 
    168     _headerLines.clear();
    169     bool firstLineRead = false;
    170     while (true) {
    171       if (socket->canReadLine()) {
    172         QString line = socket->readLine();
    173         line.chop(1);
     156    bncNetQueryV2 query;
     157    QByteArray outData;
     158    query.waitForRequestResult(url, outData);
     159    if (query.status() == bncNetQuery::finished) {
     160      _headerLines.clear();
     161      bool firstLineRead = false;
     162      QTextStream in(outData);
     163      QString line = in.readLine();
     164      while ( !line.isNull() ) {
    174165        if (line.indexOf("MARKER NAME") != -1) {
    175166          irc = success;
     
    205196          }
    206197        }
    207       }
    208       else {
    209         socket->waitForReadyRead(timeOut);
    210         if (socket->bytesAvailable() > 0) {
    211           continue;
    212         }
    213         else {
    214           break;
    215         }
    216       }
    217     }
     198        line = in.readLine();
     199      }
     200    }
     201    else {
     202      return failure;
     203    }
     204
    218205  }
    219206  return irc;
Note: See TracChangeset for help on using the changeset viewer.