Changeset 769 in ntrip


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

* empty log message *

Location:
trunk/BNS
Files:
2 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
  • trunk/BNS/bns.h

    r763 r769  
    22#define BNS_H
    33
     4#include <QtNetwork>
    45#include <QThread>
    5 #include <QMutex>
    66
    77#include "bnseph.h"
     
    1919 
    2020 private slots:
     21  void slotNewConnection();
    2122  void slotMessage(const QByteArray msg);
    2223  void slotError(const QByteArray msg);
     
    2425 private:
    2526  void deleteBnsEph();
    26   t_bnseph* _bnseph;
    27   QMutex    _mutex;
     27  QTcpServer* _clkServer;
     28  QTcpSocket* _clkSocket;
     29  t_bnseph*   _bnseph;
     30  QMutex      _mutex;
    2831};
    2932#endif
Note: See TracChangeset for help on using the changeset viewer.