Re: Socket_Socket as "extended copy" of Net_Socket
| From: | Stephan Seidt | Date: | Fri, 07 Feb 2003 06:10:36 +0000 |
| Subject: | Re: Socket_Socket as "extended copy" of Net_Socket | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-13045@lists.php.net to get a copy of this message | ||
As I said the possibility to create a listen sockets with it.
(>servers)
If somebody doesn't have "sockets" extension the new package
can't work. So if sockets extension is not available a Net_Socket
is being returned so the user can use it.
Jon Parise wrote:
On Thu, Feb 06, 2003 at 07:41:38PM +0100, Stephan Seidt wrote:-- if (!$TCPA->connect()) { throw new Exception('Sorry, no coffe today', EX_FATAL); }I just suggested the "Socket" category some time ago and also its first package Socket_Socket. To use it seriously I thought about some compatiblity options with the Net_Socket package. What about sth like: if (!extension_loaded('sockets')) { return &new Net_Socket; } I copy Net_Socket to Socket_Socket and change the code in it to work with the new sockets. I also add the new functions bind, listen, accept, select, etc.Why don't you just make Net_Socket "smarter"? Introducing two socket packages seems redundants to me (although I don't really know what additional functionality is to be provided by your Socket_Socket class).