From 6da14489cebc2f3c7e6e8e2788ffd04046bd8533 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 4 Dec 2006 23:53:05 +0000 Subject: Added the writeAllOutput function to Connection. It's handy. --- src/connection.cpp | 6 ++++++ src/connection.h | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/connection.cpp b/src/connection.cpp index aa130db..0dff918 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -358,6 +358,12 @@ bool Connection::writeOutput() return true; } +bool Connection::writeAllOutput() +{ + while( hasOutput() ) writeOutput(); + return true; +} + bool Connection::hasOutput() { if( xOutputBuf.getLength() == 0 ) diff --git a/src/connection.h b/src/connection.h index b5b121b..5d2d9bd 100644 --- a/src/connection.h +++ b/src/connection.h @@ -295,11 +295,16 @@ public: */ void waitForInput( int nBytesIn, int nSec, int nUSec ); - /** Writes all data that is pending to the socket. + /** Writes some data that is pending to the socket. *@returns True if all data was written succesfully, false otherwise. */ bool writeOutput(); + /** + * Writes all data that is pending on the socekt. + */ + bool writeAllOutput(); + /** Determines if the connection has output waiting to go out. *@returns true if there is pending output, otherwise false. */ -- cgit v1.2.3