From 0acdeb045f1bf6caae786c474d99cea68071f31f Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 21 Jun 2006 22:50:21 +0000 Subject: Updated the readInput function to tell you how much time is left over after blocking. --- src/connection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/connection.cpp') diff --git a/src/connection.cpp b/src/connection.cpp index a277ea7..5b79dfe 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -238,7 +238,7 @@ bool Connection::readInput() return true; } -bool Connection::readInput( int nSec, int nUSec ) +bool Connection::readInput( int nSec, int nUSec, int *pnSecBack, int *pnUSecBack ) { fd_set rfds; struct timeval tv; @@ -252,7 +252,9 @@ bool Connection::readInput( int nSec, int nUSec ) tv.tv_usec = nUSec; retval = select( nSocket+1, &rfds, NULL, NULL, &tv ); - /* Don't rely on the value of tv now! */ + + if( pnSecBack ) (*pnSecBack) = tv.tv_sec; + if( pnUSecBack ) (*pnUSecBack) = tv.tv_usec; if (retval == -1) { -- cgit v1.2.3