From 0c2d075e795858779af102e932a881498e2268ae Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 25 Aug 2006 20:24:31 +0000 Subject: Added a new exception for connecitons, and added a new function to the connection class, that reads at least n bytes in x seconds. --- src/connection.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/connection.h') diff --git a/src/connection.h b/src/connection.h index 29fcc25..5e86ff4 100644 --- a/src/connection.h +++ b/src/connection.h @@ -283,6 +283,18 @@ public: */ bool readInput( int nSec, int nUSec, int *pnSecBack=NULL, int *pnUSecBack=NULL ); + /** + * Waits until at least nBytesIn are read into the input buffer and ready + * to be used. Wait at most nSec seconds plus nUSec micro seconds. + * If the timeout is exceeded, this function throws an exception. If this + * function returns normally, you are guranteed to have at least nBytesIn + * bytes in your input buffer. + *@param nBytesIn Number of bytes to read. + *@param nSec The max seconds to wait. + *@param sUSec The max microseconds to wait. + */ + void waitForInput( int nBytesIn, int nSec, int nUSec ); + /** Writes all data that is pending to the socket. *@returns True if all data was written succesfully, false otherwise. */ -- cgit v1.2.3