Changeset 830 in ntrip


Ignore:
Timestamp:
Apr 15, 2008, 10:36:05 AM (17 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bns.cpp

    r829 r830  
    7474    }
    7575  }
    76 
    77   openCaster();
    7876}
    7977
     
    218216    if (_clkSocket && _clkSocket->state() == QAbstractSocket::ConnectedState) {
    219217      if ( _clkSocket->canReadLine()) {
     218        if (_outSocket == 0) {
     219          openCaster();
     220        }
    220221        readEpoch();
    221222      }
  • trunk/BNS/bnseph.cpp

    r829 r830  
    2626////////////////////////////////////////////////////////////////////////////
    2727t_bnseph::t_bnseph(QObject* parent) : QThread(parent) {
    28 
    29   QSettings settings;
    30   QString host = "localhost";
    31   int     port = settings.value("ephPort").toInt();
    32 
    33   _socket = new QTcpSocket();
    34   _socket->connectToHost(host, port);
    35 
    36   const int timeOut = 3*1000;  // 3 seconds
    37   if (!_socket->waitForConnected(timeOut)) {
    38     emit(error("bnseph::run Connect Timeout"));
    39   }
     28  _socket = 0;
    4029}
    4130
     
    5241  emit(newMessage("bnseph::run Start"));
    5342
    54   while (true) {
    55     if (_socket->state() != QAbstractSocket::ConnectedState) {
    56       emit(error("bnseph::not connected"));
    57       break;
    58     }
    59     if (_socket->canReadLine()) {
    60       readEph();
    61     }
    62     else {
    63       _socket->waitForReadyRead(10);
     43  // Connect the Socket
     44  // ------------------
     45  QSettings settings;
     46  QString host = "localhost";
     47  int     port = settings.value("ephPort").toInt();
     48
     49  _socket = new QTcpSocket();
     50  _socket->connectToHost(host, port);
     51
     52  const int timeOut = 3*1000;  // 3 seconds
     53  if (!_socket->waitForConnected(timeOut)) {
     54    emit(error("bnseph::run Connect Timeout"));
     55  }
     56  else {
     57    while (true) {
     58      if (_socket->state() != QAbstractSocket::ConnectedState) {
     59        emit(error("bnseph::not connected"));
     60        break;
     61      }
     62      if (_socket->canReadLine()) {
     63        readEph();
     64      }
     65      else {
     66        _socket->waitForReadyRead(10);
     67      }
    6468    }
    6569  }
Note: See TracChangeset for help on using the changeset viewer.