From 35255d77b51d03915bafb9cd90fefc2ec0d07f99 Mon Sep 17 00:00:00 2001 From: Kelsey Date: Mon, 13 Oct 2014 18:46:21 -0400 Subject: [PATCH] Making setConnected protected again, adding setDisconnected to public methods so that that method can be used to flag the connection as disconnected. --- .../include/simple_message/socket/simple_socket.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/simple_message/include/simple_message/socket/simple_socket.h b/simple_message/include/simple_message/socket/simple_socket.h index 4d0108a1..0ecf016f 100644 --- a/simple_message/include/simple_message/socket/simple_socket.h +++ b/simple_message/include/simple_message/socket/simple_socket.h @@ -154,9 +154,12 @@ class SimpleSocket : public industrial::smpl_msg_connection::SmplMsgConnection return connected_; } - virtual void setConnected(bool connected) + // Internally set the state of the connection to be disconnected. + // This is needed in UDP connections to signal when a timeout has occurred + // and the connection needs to be reestablished using the handshake protocol. + virtual void setDisconnected() { - this->connected_ = connected; + setConnected(false); } /** @@ -247,6 +250,10 @@ class SimpleSocket : public industrial::smpl_msg_connection::SmplMsgConnection * \return true if function DID NOT timeout (must check flags) */ virtual bool rawPoll(int timeout, bool & ready, bool & error)=0; + virtual void setConnected(bool connected) + { + this->connected_ = connected; + } };