Changeset 1361 in ntrip


Ignore:
Timestamp:
Dec 27, 2008, 9:35:35 PM (15 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncnetrequest.cpp

    r1345 r1361  
    9292  cout << "slotReadyRead" << endl;
    9393  QByteArray buffer = _reply->readAll();
     94<<<<<<< bncnetrequest.cpp
     95  cerr << buffer.data();
     96=======
    9497
    9598  vector<string> errmsg;
     
    111114  }
    112115  _decoder->_obsList.clear();
     116>>>>>>> 1.9
    113117}
    114118
  • trunk/BNC/bncsocket.cpp

    r1360 r1361  
    4747//
    4848////////////////////////////////////////////////////////////////////////////
    49 void bncSocket::connectToHost(const QString &hostName, quint16 port,
    50                               QIODevice::OpenMode mode) {
    51   if (_socket) {
    52     _socket->connectToHost(hostName, port, mode);
    53   }
    54 }
    55 
    56 //
    57 ////////////////////////////////////////////////////////////////////////////
    58 bool bncSocket::waitForConnected(int msecs) {
    59   if (_socket) {
    60     return _socket->waitForConnected(msecs);
    61   }
    62   else {
    63     return false;
    64   }
    65 }
    66 
    67 //
    68 ////////////////////////////////////////////////////////////////////////////
    6949QAbstractSocket::SocketState bncSocket::state() const {
    7050  if (_socket) {
     
    8868qint64 bncSocket::bytesAvailable() const {
    8969  if      (_http) {
    90     for (int ii = 1; ii < 10; ii++) {
    91       cout << "bytesAvailable " << _http->bytesAvailable() << endl;
    92       msleep(100);
    93     }
    9470    return _http->bytesAvailable();
    9571  }
     
    133109////////////////////////////////////////////////////////////////////////////
    134110bool bncSocket::waitForReadyRead(int msecs) {
    135   if      (_http) {
    136     msleep(10);
    137   }
    138   else if (_socket) {
     111  if (_socket) {
    139112    return _socket->waitForReadyRead(msecs);
    140113  }
     
    152125  else {
    153126    return -1;
    154   }
    155 }
    156 
    157 //
    158 ////////////////////////////////////////////////////////////////////////////
    159 qint64 bncSocket::write(const char* data, qint64 len) {
    160   if (_socket) {
    161     return _socket->write(data, len);
    162   }
    163   else {
    164     return -1;
    165   }
    166 }
    167 
    168 //
    169 ////////////////////////////////////////////////////////////////////////////
    170 bool bncSocket::waitForBytesWritten(int msecs) {
    171   if (_socket) {
    172     return _socket->waitForBytesWritten(msecs);
    173   }
    174   else {
    175     return false;
    176127  }
    177128}
     
    315266         << _http->errorString().toAscii().data() << endl;
    316267  }
     268  cout << _buffer->data().data();
    317269}
    318270
     
    321273void bncSocket::slotReadyRead() {
    322274  cout << "slotReadyRead " << _buffer->size() << endl;
    323 }
    324 
    325 //
    326 ////////////////////////////////////////////////////////////////////////////
    327 void bncSocket::slotSslErrors(const QList<QSslError>&) {
    328   cout << "slotSslError" << endl;
    329275}
    330276
     
    337283         << _http->errorString().toAscii().data() << endl;
    338284  }
     285  emit quitEventLoop();
    339286}
    340287
     
    344291                         const QByteArray& longitude, const QByteArray& nmea,
    345292                         int timeOut, QString& msg) {
     293
     294  _eventLoop = new QEventLoop();
     295  connect(this, SIGNAL(quitEventLoop()), _eventLoop, SLOT(quit()));
    346296
    347297  delete _http;
     
    370320  connect(_http, SIGNAL(requestFinished(int, bool)),
    371321          this, SLOT(slotRequestFinished(int, bool)));
    372   connect(_http, SIGNAL(sslErrors(const QList<QSslError>&)),
    373           this, SLOT(slotSslErrors(const QList<QSslError>&)));
    374322
    375323  _buffer = new QBuffer();
     
    379327  _http->request(request, 0, _buffer);
    380328
     329  ///  _eventLoop->exec(QEventLoop::ExcludeUserInputEvents);
     330
     331  cout << "before return" << endl;
    381332  return success;
    382333}
    383 
    384 // void startQuery(...)
    385 // {
    386 //      m_eventLoop = new QEventLoop(this);
    387 //      connect(this, SIGNAL(singleQueryDone()), m_eventLoop, SLOT(quit()));
    388 //      connect( qHttp, SIGNAL( requestFinished(int,bool) ), this,
    389 //              SLOT( dataDone(int, bool) ) );
    390 //      qHttp->request( header, QByteArray(), m_buffer );
    391 // }
    392 //
    393 // void dataDone( int, bool )
    394 // {
    395 //      emit singleQueryDone();
    396 // }
    397 //
    398 // void blockingThing()
    399 // {
    400 //         startQuery( );
    401 //         m_eventLoop->exec(QEventLoop::ExcludeUserInputEvents);
    402 // }
    403 //
Note: See TracChangeset for help on using the changeset viewer.