Changeset 2645 in ntrip


Ignore:
Timestamp:
Nov 5, 2010, 8:25:05 AM (14 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bnscaster.cpp

    r2643 r2645  
    9393// Start the Communication with NTRIP Caster
    9494////////////////////////////////////////////////////////////////////////////
    95 void t_bnscaster::open(bool force) {
     95void t_bnscaster::open() {
    9696
    9797  if (_mountpoint.isEmpty()) {
     
    9999  }
    100100
    101   if (_outSocket != 0) {
    102     if ( _outSocket->state() == QAbstractSocket::HostLookupState ||
    103          _outSocket->state() == QAbstractSocket::ConnectingState ||
    104          _outSocket->state() == QAbstractSocket::ConnectedState ) {
    105       return;
    106     }
     101  if (_outSocket != 0 &&
     102      _outSocket->state() == QAbstractSocket::ConnectedState) {
     103    return;
    107104  }
    108105
     
    113110    _sOpenTrial = 4;
    114111  }
    115   if (!force &&
    116       _outSocketOpenTime.isValid() &&
     112  if (_outSocketOpenTime.isValid() &&
    117113      _outSocketOpenTime.secsTo(QDateTime::currentDateTime()) < minDt) {
    118114    return;
     
    221217////////////////////////////////////////////////////////////////////////////
    222218void t_bnscaster::write(char* buffer, unsigned len) {
    223   for (int iTrial = 1; iTrial <= 2; ++iTrial) {
    224     if (_outSocket) {
    225       unsigned bytesWritten = _outSocket->write(buffer, len);
    226       if (bytesWritten == len) {
    227         _outSocket->flush();
    228         break;
    229       }
    230       else {
    231         emit(newMessage("Broadcaster: cannot write to socket, closing"));
    232         delete _outSocket;
    233         _outSocket = 0;
    234         open(true);
    235       }
    236     }
     219  if (_outSocket) {
     220    _outSocket->write(buffer, len);
     221    _outSocket->flush();
    237222  }
    238223}
  • trunk/BNS/bnscaster.h

    r2643 r2645  
    1010  t_bnscaster(const QString& mountpoint);
    1111  virtual ~t_bnscaster();
    12   void open(bool force = false);
     12  void open();
    1313  void write(char* buffer, unsigned len);
    1414  void printAscii(const QString& line);
  • trunk/BNS/bnseph.cpp

    r2644 r2645  
    9090  const int timeOut = 30*1000;  // 30 seconds
    9191  if (!_socket->waitForConnected(timeOut)) {
    92     emit(newMessage("bnseph::reconnect: Connect Timeout"));
     92//  emit(newMessage("bnseph::run Connect Timeout"));
     93    emit(newMessage("Ephemeris server: Connection timeout")); // weber
    9394    msleep(1000);
    9495  }
     
    99100void t_bnseph::run() {
    100101
    101   emit(newMessage("bnseph::run: Start"));
     102//emit(newMessage("bnseph::run Start"));
     103  emit(newMessage("Ephemeris server: Connection opened")); // weber
    102104
    103105  while (true) {
    104106    if ( _socket == 0 ||
    105          (_socket->state() != QAbstractSocket::HostLookupState &&
    106           _socket->state() != QAbstractSocket::ConnectingState &&
     107         (_socket->state() != QAbstractSocket::ConnectingState &&
    107108          _socket->state() != QAbstractSocket::ConnectedState) ) {
    108109      reconnect();
Note: See TracChangeset for help on using the changeset viewer.