Other socket stuff
| From: | Rasmus Lerdorf | Date: | Wed, 26 May 1999 15:08:05 +0000 |
| Subject: | Other socket stuff | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6020@lists.php.net to get a copy of this message | ||
Sascha, you are speeding along at an amazing pace on this stuff! Since I
don't want to risk you running out of things to do, I have something on my
TODO list here that I have been avoiding. ;)
It would be extremely handy if the various network-related functions could
be timed out on their initial socket connection. Once connected, you can
toss the connection into non-blocking mode and timeouts aren't an issue.
But you can't do a non-blocking initial connect.
The obvious solution is to use an alarm() call and somehow let the user
specify a timeout to feed to this call. Then catch SIGALRM. The one
slight problem here is that Apache uses SIGALRM and this has been the main
reason this hasn't been implemented. Apache 2.0 is unlikely to eat up
SIGALRM on us, and after a bit of testing, I think we can actually use
SIGALRM even with Apache-1.3.x. It wouldn't be super-safe, and in a
worst-case scenario, things might go wrong, but in 99.9% of the cases it
should be safe to temporarily grab SIGALRM for the purposes of a connect
and then restore the Apache handler afterwards.
What are your thoughts on this?
-Rasmus
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net