Home
Roadside
Carputer
geoHist
software
FRC
Blog
Now you can download a copy of these docs so you can use them offline!
Download now
Main Page
Related Pages
Classes
Files
File List
networktables2
connection
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
12
ConnectionMonitorThread::ConnectionMonitorThread
(
ConnectionAdapter
& _adapter,
NetworkTableConnection
& _connection) :
13
adapter(_adapter), connection(_connection) {
14
}
15
16
void
ConnectionMonitorThread::run
() {
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
ConnectionAdapter::badMessage
virtual void badMessage(BadMessageException &e)=0
BadMessageException
Definition:
BadMessageException.h:14
IOException
Definition:
IOException.h:16
ConnectionAdapter::ioException
virtual void ioException(IOException &e)=0
ConnectionAdapter
Definition:
ConnectionAdapter.h:18
NetworkTableConnection
Definition:
NetworkTableConnection.h:30
ConnectionMonitorThread::ConnectionMonitorThread
ConnectionMonitorThread(ConnectionAdapter &adapter, NetworkTableConnection &connection)
Definition:
ConnectionMonitorThread.cpp:12
ConnectionMonitorThread::run
void run()
Definition:
ConnectionMonitorThread.cpp:16
Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by
1.8.6
© 2006-2009 Dustin Spicuzza. All rights reserved.
Powered by Onnac
I do not condone or encourage graffiti. Please paint responsibly.