Skip to content

Commit

Permalink
add Connection::flush();
Browse files Browse the repository at this point in the history
  • Loading branch information
shen2 committed Sep 15, 2014
1 parent d75159a commit 3324429
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Response/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3324429

Please sign in to comment.