Re: Improved socket handling?
| From: | Ciprian Popovici | Date: | Wed, 14 Dec 2005 09:40:52 +0000 |
| Subject: | Re: Improved socket handling? | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6377@lists.php.net to get a copy of this message | ||
Quoting Benjamin Smith <lists@benjamindsmith.com>:
> Is there a way to improve socket handling?
Yes. Open the socket in non-blocking mode (see stream_set_blocking()). This
way operations return immediately, regardless of whether they got any data or
not. Just remember to do an usleep() with a small value in the read cycle,
otherwise you risk maxing out the CPU.
--
Ciprian Popovici