Re: Net_Socket -> 1.0.3 ?

From: Date: Sat, 08 May 2004 16:52:18 +0000
Subject: Re: Net_Socket -> 1.0.3 ?
References: 1 2 3 4 5 6  Groups: php.pear.dev php.pear.dev 
Request: Send a blank email to pear-dev+get-29032@lists.php.net to get a copy of this message
Chuck Hagenbuch wrote:
Thing is, it's not such a minor thing; for low-level socket handling and apps that use a lot of sockets, cutting the object size in half (at least?) is a big win.
(sorry, my thread, but seemingly not paying attention -- seems mail @php.net is broked) I agree -- this is a major thing, not only because the object size is smaller, now, but using a lot of sockets used to not work AT ALL, consider this: <?php require_once('PEAR.php'); require_once('Net/Socket.php'); // change addr to a local (or remote, but slow) web server $addr = 'localhost'; $port = 80; $data = "GET / HTTP/1.0\n\n"; // iterate.. for ($n=0; $n<=66000; $n++) { $sock = & new Net_Socket(); $sock->connect($addr, $port); $sock->write($data); if ($n % 1000 == 0) {
    echo "$n requests\n";
} } echo "$n\n"; //////////// output: 0 requests 1000 requests 2000 requests 3000 requests 4000 requests 5000 requests 6000 requests 7000 requests 8000 requests 9000 requests 10000 requests 11000 requests 12000 requests 13000 requests 14000 requests Segmentation fault ---- Yes, this can be solved by instanciating Net_Socket by value, but last I checked HTTP_Request (for instance), did it as above. S

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