summaryrefslogtreecommitdiffstats
path: root/src/RemoteControl.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-01-24 14:11:19 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-01-24 14:11:19 +0100
commitf75ac25e6e93ab167b5f3cfdecbbbf286fdc4fed (patch)
tree6bcc8fe0786404fc3793dbfc53742b12380270c1 /src/RemoteControl.h
parent63636d3d211b92e5adb9653db9b06b62278cb889 (diff)
downloaddabmux-f75ac25e6e93ab167b5f3cfdecbbbf286fdc4fed.tar.gz
dabmux-f75ac25e6e93ab167b5f3cfdecbbbf286fdc4fed.tar.bz2
dabmux-f75ac25e6e93ab167b5f3cfdecbbbf286fdc4fed.zip
Implement remote control and global_stats, and add to configuration
Diffstat (limited to 'src/RemoteControl.h')
-rw-r--r--src/RemoteControl.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/RemoteControl.h b/src/RemoteControl.h
index 77dbff4..7dcda0a 100644
--- a/src/RemoteControl.h
+++ b/src/RemoteControl.h
@@ -123,20 +123,20 @@ class RemoteControllable {
*/
class RemoteControllerTelnet : public BaseRemoteController {
public:
- RemoteControllerTelnet(int port) {
- m_port = port;
- m_running = false;
- };
+ RemoteControllerTelnet()
+ : m_running(false), m_port(0) {}
- void start() {
- m_running = true;
- m_child_thread = boost::thread(&RemoteControllerTelnet::process, this, 0);
- }
+ RemoteControllerTelnet(int port)
+ : m_running(true), m_port(port),
+ m_child_thread(&RemoteControllerTelnet::process, this, 0)
+ {}
- void stop() {
+ ~RemoteControllerTelnet() {
m_running = false;
- m_child_thread.interrupt();
- m_child_thread.join();
+ if (m_port) {
+ m_child_thread.interrupt();
+ m_child_thread.join();
+ }
}
void process(long);
@@ -151,6 +151,9 @@ class RemoteControllerTelnet : public BaseRemoteController {
private:
+ RemoteControllerTelnet& operator=(const RemoteControllerTelnet& other);
+ RemoteControllerTelnet(const RemoteControllerTelnet& other);
+
vector<string> tokenise_(string message) {
vector<string> all_tokens;