From: Camilo Roca Date: Thu, 18 Jul 2013 10:04:25 +0000 (+0200) Subject: reset timeout if connection is active. X-Git-Tag: latest_release~6 X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=commitdiff_plain;h=ce44999e70624278911ab8bcc67881268665c30f reset timeout if connection is active. --- diff --git a/src/socket_server.cpp b/src/socket_server.cpp index 1d18fd2..d6ca439 100644 --- a/src/socket_server.cpp +++ b/src/socket_server.cpp @@ -324,4 +324,11 @@ void socket_server_connection::close() } } +bool socket_server_connection::fill_buffer(long long usec_timeout,long long* usec_timeout_remaining) +{ + bool new_data = socket_handler::fill_buffer(buffer,usec_timeout,usec_timeout_remaining); + if (new_data) + reset_timeout(); + return new_data; +} } diff --git a/src/socket_server.hxx b/src/socket_server.hxx index 74d8e07..bbba379 100644 --- a/src/socket_server.hxx +++ b/src/socket_server.hxx @@ -95,8 +95,7 @@ class socket_server_connection : public socket_handler, public server_connection { socket_write(data); } public: - bool fill_buffer(long long usec_timeout=-1,long long* usec_timeout_remaining=NULL) - { return socket_handler::fill_buffer(buffer,usec_timeout,usec_timeout_remaining); } + bool fill_buffer(long long usec_timeout=-1,long long* usec_timeout_remaining=NULL); virtual void close(); };