aboutsummaryrefslogtreecommitdiff
path: root/src/connection.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-06-21 22:50:21 +0000
committerMike Buland <eichlan@xagasoft.com>2006-06-21 22:50:21 +0000
commit0acdeb045f1bf6caae786c474d99cea68071f31f (patch)
tree280691a5ecd6d488822f73a90a4f26b5da7fe682 /src/connection.cpp
parent5f029cf734e1c84b7dcde8383bbc85aada08ee1c (diff)
downloadlibbu++-0acdeb045f1bf6caae786c474d99cea68071f31f.tar.gz
libbu++-0acdeb045f1bf6caae786c474d99cea68071f31f.tar.bz2
libbu++-0acdeb045f1bf6caae786c474d99cea68071f31f.tar.xz
libbu++-0acdeb045f1bf6caae786c474d99cea68071f31f.zip
Updated the readInput function to tell you how much time is left over after
blocking.
Diffstat (limited to 'src/connection.cpp')
-rw-r--r--src/connection.cpp6
1 files changed, 4 insertions, 2 deletions
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()
238 return true; 238 return true;
239} 239}
240 240
241bool Connection::readInput( int nSec, int nUSec ) 241bool Connection::readInput( int nSec, int nUSec, int *pnSecBack, int *pnUSecBack )
242{ 242{
243 fd_set rfds; 243 fd_set rfds;
244 struct timeval tv; 244 struct timeval tv;
@@ -252,7 +252,9 @@ bool Connection::readInput( int nSec, int nUSec )
252 tv.tv_usec = nUSec; 252 tv.tv_usec = nUSec;
253 253
254 retval = select( nSocket+1, &rfds, NULL, NULL, &tv ); 254 retval = select( nSocket+1, &rfds, NULL, NULL, &tv );
255 /* Don't rely on the value of tv now! */ 255
256 if( pnSecBack ) (*pnSecBack) = tv.tv_sec;
257 if( pnUSecBack ) (*pnUSecBack) = tv.tv_usec;
256 258
257 if (retval == -1) 259 if (retval == -1)
258 { 260 {