diff --git a/src/Connection.php b/src/Connection.php index 50b4a89..249939e 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -186,6 +186,15 @@ protected function _getResponse() { return $response; } + /** + * Wait until all statements received response. + */ + public function flush(){ + while(!empty($this->_statements)){ + $this->_getResponse(); + } + } + /** * @return Connection\Node */ diff --git a/src/Response/Result.php b/src/Response/Result.php index 1266153..4815b9c 100644 --- a/src/Response/Result.php +++ b/src/Response/Result.php @@ -42,7 +42,7 @@ protected function _readBytesAndConvertToType($type){ $length = unpack('N', substr($this->data, $this->offset, 4))[1]; $this->offset += 4; - if ($length === 4294967295) + if ($length === 0xffffffff) return null; // do not use $this->read() for performance