Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99810 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91687 invoked from network); 7 Jul 2017 15:04:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jul 2017 15:04:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@list.imperialat.at; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@list.imperialat.at; sender-id=pass Received-SPF: pass (pb1.pair.com: domain list.imperialat.at designates 80.101.55.235 as permitted sender) X-PHP-List-Original-Sender: php@list.imperialat.at X-Host-Fingerprint: 80.101.55.235 mail.imperialat.at Received: from [80.101.55.235] ([80.101.55.235:53475] helo=mail.imperialat.at) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1D/52-47109-7E2AF595 for ; Fri, 07 Jul 2017 11:04:08 -0400 Received: from mail.imperialat.at (localhost [127.0.0.1]) by mail.imperialat.at (OpenSMTPD) with ESMTP id b976bfab; Fri, 7 Jul 2017 17:04:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d= list.imperialat.at; h=subject:to:cc:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=deathstar; bh=E0AHPTmCO55AgV/+9FTg F6S9D1MsypHbZiGnaCkopLY=; b=Sd0gA+QvjbpROUrsfvXB2sKBkas3qrg1MHuo Sl/+96+6rXqT9zFb6hjR2JENGt3uVE01/X5UboKNhHnLx6rziu7MDmTC11JMIheh 7gFxnUrR9klN78EBJE1/Bb+pk8/QZzeHiQft6hNxfGk/ODaF5pJxguGei+deM2RB 0MISXTvxFapdPZ9wsrxkvheTtixz8wjJ09KTROV+BXZP19T9iS3HObVgXuByM05F REe88wmsaIg/a8lgkPgeimo9xDk5ggFGwPoLTRVrxCD/A6q2k8stO/Kda57V/NXW xRnBbRw+eN10EpeHSzU7cE1Xnd6o5KnWoAleqbmCtmHZieaR1g== Received: from martijn.office.rootnet.nl (095-097-046-226.static.chello.nl [95.97.46.226]) by mail.imperialat.at (OpenSMTPD) with ESMTPSA id 5d92a268 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Fri, 7 Jul 2017 17:04:04 +0200 (CEST) To: Sara Golemon Cc: Niklas Keller , Bob Weinand , Kalle Sommer Nielsen , Internals References: <105535b4-a629-b2e4-c5e9-a75ff565b054@list.imperialat.at> Message-ID: <0b2f0634-e8af-4e93-5cd4-3471d968cb2c@list.imperialat.at> Date: Fri, 7 Jul 2017 17:04:02 +0200 User-Agent: Mozilla/5.0 (X11; OpenBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Getting fd from stream From: php@list.imperialat.at (Martijn van Duren) On 07/07/17 16:38, Sara Golemon wrote: > On Fri, Jul 7, 2017 at 10:04 AM, Martijn van Duren > wrote: >> My use case is to set up a cluster of processes each with their own task >> and permission sets. These processes need to be able to communicate with >> each other over socket pairs, not just between the parent and the child, >> but also between children. >> > Sounds like you're describing unix domain sockets (or NamedPipes if > you're on Windows). > > -Sara > Yes, although tcp/ip are also possible with stream_socket_pair. The point is, regardless of unix - or tcp sockets, they still have an underlying file descriptor, which I need to specify to the child, so that they can start using it. Ergo, I need to find a way to export this from the stream into PHP. To put it in code: This returns 4 (the object id), instead of 3 (the fd). If I could get the fd, I could turn this into something like: Where whatever can be anything from a PHP-script to a C-compiled binary.