From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by sourceware.org (Postfix) with ESMTPS id 8F3D538460A3 for ; Fri, 16 Apr 2021 09:37:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8F3D538460A3 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=corinna-cygwin@cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M4bA0-1lYzLe3NNm-001gJK for ; Fri, 16 Apr 2021 11:37:56 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 2AAE6A80DAB; Fri, 16 Apr 2021 11:37:56 +0200 (CEST) Date: Fri, 16 Apr 2021 11:37:56 +0200 From: Corinna Vinschen To: cygwin-developers@cygwin.com Subject: Re: Problems with the (new) implementation of AF_UNIX datagram sockets Message-ID: Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com References: <1cfa2d74-eaa4-e3be-9fa5-519952026aef@cornell.edu> <9db1d7ab-fe47-6f8c-db65-c9fe5e18952b@maxrnd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9db1d7ab-fe47-6f8c-db65-c9fe5e18952b@maxrnd.com> X-Provags-ID: V03:K1:E69WBsBb3ug6mbPPg8fmeqEOGhPw+a+JEmqJq3ViI7bzPThMF9/ IahBjmiz8SMTtSjN5xPrgp657V4/kpjdpD8xu+fLXDQIq7qJzQgYEUOwa2/q6sZD1ZYqY59 bCevpunlVFz7/Q0sMVxA/aCK/tLn3oWD+n/gimQ63kZ9oEuDjX1lh1woO+7WAYj3+oKy7jU PESfI6pStqtjKNWM3J9bg== X-UI-Out-Filterresults: notjunk:1;V03:K0:zSs2KkFw+wg=:7U9JAPWxc8be+VIvb3IKxQ WK5FT6k4vnyUJoZA3KUoXzLxAysGCKbOf3ddgkBpKM7lPX2KAIL31TuLg0QbdmUw6Szt+Ubm2 kLD4MNxs3wSxxrpKUNVs8ckhlzi7LVFTYkYFbNaEunXX4dd0QyXup/+qNhyVI9Y7aTMP/BTUA VWnKKZuScWmR9R/9CnieohuLMeQ3ui2E5R4KzJS9LXG3odReEgVyWAtDypvk6kcCMu2wJtNr+ ta1oEOZoRk6xl8oL6XOypSbhJdKSG2ri/T75Misph7tT0O7FumPP1B1uxWkBMlsBwoRzbRMqu vwxhOrEAnOzSyaAIQJ5licZePYsHS9KgKdYk/w5yCR9Ht42qiU8tNCG6PkWSW33osHX9G5RQm 0SpEeisO5kba+iZLBzsaCWFtbMQXbqPwPsQpuNCcVUr6JyNaXlrDhiCe9cSz78X2O3Ozk5ofN a6YgAhMvK8rUFoWTxGGIpObgdnZV7q37KU98FuMqDWpKvaI1J2AQwEXftXylwLGEwWzPAdSjZ W5t07pqcLwBtb9VUd4ujgg= X-Spam-Status: No, score=-100.7 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2021 09:38:01 -0000 On Apr 15 16:50, Mark Geisert wrote: > Ken Brown wrote: > > On 4/15/2021 9:58 AM, Corinna Vinschen wrote: > > > On Apr 15 09:16, Ken Brown wrote: > > > > On 4/15/2021 7:49 AM, Corinna Vinschen wrote: > > > > [...] > > > > > Another idea might be to implement send/recv on a DGRAM socket a bit > > > > > like accept.  Rather than creating a single_instance socket, we create a > > > > > max_instance socket as for STREAM socket listeners.  The server side > > > > > accepts the connection at recv and immediately opens another pipe > > > > > instance, so we always have at least one dangling instance for the next > > > > > peer. > > > > > > > > I thought about that, but you would still have the problem (as in 1 above) > > > > that the pipe instance isn't available until recv is called. > > > > > > There always is at least one instance.  Do you mean, two clients are > > > trying to send while the server is idly playing with his toes? > > > > Yes.  That was essentially the situation in the test case attached to > > > >   https://cygwin.com/pipermail/cygwin/2021-April/248210.html > > > > It was actually one client sending many messages while the server was > > playing with his toes, but the effect was the same. > > Sending datagrams between processes on the same system could be thought of > as similar to sending/receiving messages on a POSIX message queue. Though > the mq_* man pages make it seem like mqs are intended for within-process > messaging. But if a datagram receiver created a message queue that datagram > senders could open, couldn't that provide buffering and allow multiple > clients? Kindly ignore if insane. Interesting idea, actually. Message queues already implement a lot of what a unix socket needs in terms of sending/receiving data. The pipe would only be needed for credential and descriptor passing, ultimately :) Corinna