From 0217a74f130ee8075537a4f1316f554c25d51fe2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 30 Aug 2008 05:57:09 -0400 Subject: check the state of the queue before diving in to process it darcs-hash:20080830095709-84dde-a64262c1b32e506cb2c43f8b4fb55ab88effc22f.gz --- extlib/XMPPHP/XMLStream.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'extlib/XMPPHP/XMLStream.php') diff --git a/extlib/XMPPHP/XMLStream.php b/extlib/XMPPHP/XMLStream.php index 4de23ef7f..62aa4de89 100644 --- a/extlib/XMPPHP/XMLStream.php +++ b/extlib/XMPPHP/XMLStream.php @@ -616,4 +616,12 @@ class XMPPHP_XMLStream { xml_set_element_handler($this->parser, 'startXML', 'endXML'); xml_set_character_data_handler($this->parser, 'charXML'); } + + public function readyToProcess() { + $read = array($this->socket); + $write = null; + $except = null; + $updated = @stream_select($read, $write, $except, 0); + return $updated !== false; + } } -- cgit v1.2.3-54-g00ecf