Changeset 1414 in ntrip


Ignore:
Timestamp:
Dec 31, 2008, 1:07:51 PM (15 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncnetqueryrtp.cpp

    r1413 r1414  
    2929  _socket    = 0;
    3030  _udpSocket = 0;
     31  _eventLoop = new QEventLoop(this);
    3132}
    3233
     
    3435////////////////////////////////////////////////////////////////////////////
    3536bncNetQueryRtp::~bncNetQueryRtp() {
     37  delete _eventLoop;
    3638  delete _socket;
    3739  delete _udpSocket;
     
    4143////////////////////////////////////////////////////////////////////////////
    4244void bncNetQueryRtp::stop() {
    43 #ifndef sparc
    44   if (_socket) {
    45     _socket->abort();
    46   }
    47 #endif
     45  _eventLoop->quit();
    4846  _status = finished;
    4947}
     
    5755////////////////////////////////////////////////////////////////////////////
    5856void bncNetQueryRtp::waitForReadyRead(QByteArray& outData) {
     57
     58  // Wait Loop
     59  // ---------
     60  if (!_udpSocket->hasPendingDatagrams()) {
     61    _eventLoop->exec();
     62  }
     63
     64  // Append Data
     65  // -----------
     66  QByteArray datagram;
     67  datagram.resize(_udpSocket->pendingDatagramSize());
     68  _udpSocket->readDatagram(datagram.data(), datagram.size());
     69  outData.append(datagram);
    5970}
    6071
     
    104115    _udpSocket = new QUdpSocket();
    105116    _udpSocket->bind(clientPort.toInt());
     117    connect(_udpSocket, SIGNAL(readyRead()), _eventLoop, SLOT(quit()));
    106118   
    107119    QByteArray reqStr;
Note: See TracChangeset for help on using the changeset viewer.