Re: Idea for Net_Socket

From: Date: Sun, 30 Jan 2005 16:46:40 +0000
Subject: Re: Idea for Net_Socket
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-35804@lists.php.net to get a copy of this message
Hi Matthew, Could you please file this as a bug at http://pear.php.net/package/net_socket so it won't get lost in the mails? Thanks, Cipri@php.net ----- Original Message ----- From: "Matthew Fonda" <mfonda@dotgeek.org> To: <pear-dev@lists.php.net> Sent: 30 January, 2005 01:02 Subject: [PEAR-DEV] Idea for Net_Socket
Hello, I have been using Net_Socket, and I noticed that if the it fails to connect in the Net_Socket::connect method for whatever reason, it creates a fatal php error as opposed to raising a pear error like it looks like its supposed to. This could be fixed easily by just adding @ before it to suppress errors. So change line 106/108 to $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $this->timeout); $fp = @$openfunc($this->addr, $this->port, $errno, $errstr); The code right after the connection is: if (!$fp) { return $this->raiseError($errstr, $errno); } but that will never be true, because it will die if the connection failed, so it wouldnt make it to that line. Maybe it was meant to be that way, but I think it would be a lot nicer to have a PEAR error and handle if it didnt connect on my own, than have a fatal PHP error. Thanks -- Regards, Matthew Fonda -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.dev (#35804) next »