Changeset 269 in flair-src for trunk/tools/FlairGCS/src/UdtSocket.cpp
- Timestamp:
- 10/04/18 13:53:11 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/FlairGCS/src/UdtSocket.cpp
r258 r269 66 66 // disconnection of ground station 67 67 void UdtSocket::heartbeat(void) { 68 //printf("h %s %i.%i\n",name.toLocal8Bit().constData(),QTime::currentTime().second(),QTime::currentTime().msec()); 68 69 char data = WATCHDOG_HEADER; 69 70 quint64 sent=write(&data, 1,HEARTBEAT_TIMER,true); … … 161 162 } else if(readfds==socket && num==1 && rv==1) { 162 163 int size; 164 QTime initTime; 165 initTime.start(); 163 166 do { 167 //we are in "infinite" loop, so let the heartbeat run if needed 168 if(initTime.elapsed()>HEARTBEAT_TIMER) { 169 initTime.start(); 170 //do not use error check of heartbeat() method: (otherwise, closes com too early) 171 char data = WATCHDOG_HEADER; 172 UDT::sendmsg(socket, &data, 1, HEARTBEAT_TIMER, true); 173 } 174 164 175 size=UDT::recvmsg(socket, buf, buf_size); 165 176
Note:
See TracChangeset
for help on using the changeset viewer.