Throws an exception on fail in connect.

This commit is contained in:
Juan Basso 2010-11-09 18:58:29 -02:00
parent b46b861383
commit fb5495fad5

View file

@ -100,6 +100,7 @@ class CakeSocket {
* Connect the socket to the given host and port.
*
* @return boolean Success
* @throws Exception
*/
public function connect() {
if ($this->connection != null) {
@ -119,6 +120,7 @@ class CakeSocket {
if (!empty($errNum) || !empty($errStr)) {
$this->setLastError($errStr, $errNum);
throw new Exception($errStr, $errNum);
}
$this->connected = is_resource($this->connection);