Skip to content

Commit

Permalink
Making setConnected protected again, adding setDisconnected to public…
Browse files Browse the repository at this point in the history
… methods so that that method can be used to flag the connection as disconnected.
  • Loading branch information
kphawkins committed Oct 13, 2014
1 parent 21e4992 commit 35255d7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions simple_message/include/simple_message/socket/simple_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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;
}

};

Expand Down

0 comments on commit 35255d7

Please sign in to comment.