Re: Extension proposal: fdpass
| From: | Florian Wilkemeyer | Date: | Wed, 27 Apr 2011 11:13:17 +0000 |
| Subject: | Re: Extension proposal: fdpass | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-8187@lists.php.net to get a copy of this message | ||
Hi Jille,
i had the same requirements and i wrote a simple function and added it to the php sockets extension;
to be able to create a 'php-socket' from a FD number (in my case my script gets forked from a webserver - which gives a acceptable pipe as fd#0 to the proc..)
so it was possible to use the whole functionallity from php's socket extension..
If there's any interest i would provide the patch here,
but its linux/unix based OS only.. no win32 :)
Greetings
Florian
Am 25.04.2011 15:44, schrieb Jille Timmermans:
Hello all, I spent my weekend writing an extension which allows file-descriptor passing. In case you are not familiar with it: You can pass file-descriptors (sockets, files etc) over another file-descriptor to another proces. This would allow a masterproces to accept incoming connections, choosing a worker and passing the client-socket to a worker which can communicatie directly with the client from that moment. You can find the first version here: http://junk.quis.cx/iVDmcRbb/fdpass-0.1.tbz2 The way I retreive the file-descriptors from the streams should probably be made somewhat less ugly and more API-change-stable. I think I should contact Wez Furlong for that. The account-request page asked me to tell something about myself, so if anybody's interested, here we go. I'm an 20 year old undergraduate at the "Radboud University" in Nijmegen, The Netherlands. I probably won't finish my study due to motivationproblems with (imho) boring classes. I'm employed at Hexon B.V. (www.hexon.cx), a small company working for the Automotive Bussiness. I am responsible for internal development there. As I do PHP-stuff at work as well you might also see me at jille@hexon.cx (instead of quis.cx, my personal domain). I recently created a slab allocator in addition to the default Zend memory allocator but haven't managed to do reliable tests. (I think the speed-improvements vary from -5% to +5% and the memory-usage seems to reduce by 4%.) If anybody is interested I will post a patch somewhere. I guess I should now fill in the form at http://pecl.php.net/account-request.php. I'm sorry if I was supposed to wait for an answer from the list. -- Jille