From 5b08c0883c83c95ceca07e590620fe254b17f6ab Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 24 May 2005 01:49:07 +0000 Subject: Added ping checks for server links (experimental) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1481 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/connection.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') diff --git a/include/connection.h b/include/connection.h index 8f5efe2d7..88dc3ea54 100644 --- a/include/connection.h +++ b/include/connection.h @@ -93,6 +93,14 @@ class ircd_connector : public Extensible */ std::string WriteError; + /** Time this connection was last pinged + */ + time_t nextping; + + /** Did this connection reply to its last ping? + */ + bool replied; + public: /** IRCD Buffer for input characters, holds as many lines as are @@ -236,6 +244,15 @@ class ircd_connector : public Extensible /** Returns true if there is data to be written that hasn't been sent yet */ bool HasBufferedOutput(); + + /** Checks if the connection replied to its last ping, and if it did + * sends another and returns true, if not, returns false. + */ + bool CheckPing(); + + /** Resets the ping counter + */ + void ResetPing(); }; -- cgit v1.2.3