Am 18.05.2011 13:13, schrieb Gustavo Lopes:
Em Wed, 18 May 2011 11:44:35 +0100, Florian Wilkemeyer <f...@f-ws.de>
escreveu:
i recently wrote small function that allows the creation of a php-socket
by directly giving the fd#
this is very useful under linux/unix environments for Ipc.
For example:
getting forked by a webserver as fastcgi / scgi .., the webserver gives
an acceptable socket as fd#0 to the process..
I submitted the patch about 3 weeks ago @ pecl-dev list in the fdpass
extension topic.
It would be nice to see such function in dist php :)
I can commit this, but a few changes are required first:
* This doesn't work on Windows, so it should be ifdef'd out on that
platform.
* The family can be detected
* The blocking behavior should be queried, not hardcoded to 1
* This patch is not up-to-date with trunk/5.4 (see php_create_socket)
For the two last points, see the implementation of
socket_import_stream in
http://lxr.php.net/opengrok/xref/PHP_TRUNK/ext/sockets/sockets.c#2434
It would be a good idea to do some refactoring and share code between
the two functions.
* (remark) "For IPC", the vast majority of use cases would be already
covered by php://fd; you would this this only for socket specific
functionality.
Okay,
#1 it's already
#2 & 3 no problem
#4 i'll checkout 5_4 today and port it to the version / see what can be
shared
i'll resubmit the fixed / changed patch, when i've applied the changes
Thanks,
Florian
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php