Changeset 769 in ntrip for trunk/BNS/bns.cpp


Ignore:
Timestamp:
Apr 6, 2008, 5:24:01 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bns.cpp

    r764 r769  
    3434  connect(_bnseph, SIGNAL(error(QByteArray)),
    3535          this, SLOT(slotError(const QByteArray)));
     36
     37  _clkServer = 0;
     38  _clkSocket = 0;
    3639}
    3740
     
    4043t_bns::~t_bns() {
    4144  deleteBnsEph();
     45  delete _clkServer;
    4246}
    4347
     
    6872}
    6973
     74// New Connection
     75////////////////////////////////////////////////////////////////////////////
     76void t_bns::slotNewConnection() {
     77  _clkSocket = _clkServer->nextPendingConnection();
     78}
     79
    7080// Start
    7181////////////////////////////////////////////////////////////////////////////
    7282void t_bns::run() {
     83
    7384  slotMessage("============ Start BNS ============");
    7485  _bnseph->start();
     86
     87  QSettings settings;
     88  int port = settings.value("clkPort").toInt();
     89
     90  _clkServer = new QTcpServer;
     91  _clkServer->listen(QHostAddress::Any, port);
     92  connect(_clkServer, SIGNAL(newConnection()), this, SLOT(slotNewConnection()));
     93
     94  while (true) {
     95    if (_clkSocket) {
     96
     97    }
     98    else {
     99      msleep(100);
     100    }
     101  }
    75102}
    76103
Note: See TracChangeset for help on using the changeset viewer.