Skip to content

Instantly share code, notes, and snippets.

@mashiro
Created October 1, 2013 17:12
Show Gist options
  • Save mashiro/6781851 to your computer and use it in GitHub Desktop.
Save mashiro/6781851 to your computer and use it in GitHub Desktop.
$response = '';
while (!feof($this->_socket_resource)) {
$response .= fgets($this->_socket_resource, 128);
}
// $response = fgets($this->_socket_resource, 128);
if(!preg_match('@^' . preg_quote(Net_Socket_Tiarra::protocol, '@') . ' 200 OK@', $response)) {
throw new Net_Socket_Tiarra_Exception("error: " . $response);
};
fclose($this->_socket_resource);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment