Changeset 769 in ntrip
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNS/bns.cpp ¶
r764 r769 34 34 connect(_bnseph, SIGNAL(error(QByteArray)), 35 35 this, SLOT(slotError(const QByteArray))); 36 37 _clkServer = 0; 38 _clkSocket = 0; 36 39 } 37 40 … … 40 43 t_bns::~t_bns() { 41 44 deleteBnsEph(); 45 delete _clkServer; 42 46 } 43 47 … … 68 72 } 69 73 74 // New Connection 75 //////////////////////////////////////////////////////////////////////////// 76 void t_bns::slotNewConnection() { 77 _clkSocket = _clkServer->nextPendingConnection(); 78 } 79 70 80 // Start 71 81 //////////////////////////////////////////////////////////////////////////// 72 82 void t_bns::run() { 83 73 84 slotMessage("============ Start BNS ============"); 74 85 _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 } 75 102 } 76 103 -
TabularUnified trunk/BNS/bns.h ¶
r763 r769 2 2 #define BNS_H 3 3 4 #include <QtNetwork> 4 5 #include <QThread> 5 #include <QMutex>6 6 7 7 #include "bnseph.h" … … 19 19 20 20 private slots: 21 void slotNewConnection(); 21 22 void slotMessage(const QByteArray msg); 22 23 void slotError(const QByteArray msg); … … 24 25 private: 25 26 void deleteBnsEph(); 26 t_bnseph* _bnseph; 27 QMutex _mutex; 27 QTcpServer* _clkServer; 28 QTcpSocket* _clkSocket; 29 t_bnseph* _bnseph; 30 QMutex _mutex; 28 31 }; 29 32 #endif
Note:
See TracChangeset
for help on using the changeset viewer.