Now you can download a copy of these docs so you can use them offline! Download now
ConnectionMonitorThread.cpp
1 /*
2  * ConnectionMonitorThread.cpp
3  *
4  * Created on: Sep 22, 2012
5  * Author: Mitchell Wills
6  */
7 
8 #include "networktables2/connection/ConnectionMonitorThread.h"
9 #include "networktables2/connection/BadMessageException.h"
10 #include "networktables2/util/System.h"
11 
13  adapter(_adapter), connection(_connection) {
14 }
15 
17 
18  if (adapter.keepAlive())
19  {
20  try{
21  connection.read(adapter);
22  } catch(BadMessageException& e){
23  adapter.badMessage(e);
24  } catch(IOException& e){
25  adapter.ioException(e);
26  }
27  }
28  else
29  {
30  sleep_ms(10); //avoid busy-wait
31  //Test to see this working properly
32  //printf("--ConnectionMonitorThread::run Waiting to close\n");
33  }
34 }
35 
virtual void badMessage(BadMessageException &e)=0
virtual void ioException(IOException &e)=0
ConnectionMonitorThread(ConnectionAdapter &adapter, NetworkTableConnection &connection)

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6