X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Fri, 8 Mar 2013 16:08:55 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Unix domain accept() and getperrname() doesn't return the client address. Message-ID: <20130308150855.GE15061@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20130304093836 DOT GB5468 AT calimero DOT vinschen DOT de> <20130307143712 DOT GA12359 AT calimero DOT vinschen DOT de> <20130308132937 DOT GA15061 AT calimero DOT vinschen DOT de> <5139F448 DOT 4000808 AT gmail DOT com> <20130308143715 DOT GD15061 AT calimero DOT vinschen DOT de> <5139F946 DOT 1050507 AT gmail DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5139F946.1050507@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Mar 8 16:44, Noel Grandin wrote: > On 2013-03-08 16:37, Corinna Vinschen wrote: > >On Mar 8 16:23, Noel Grandin wrote: > >>On 2013-03-08 15:29, Corinna Vinschen wrote: > >>>You can call connect on both sides. But ultimately you're right, I > >>>guess. I never thought about it that way, and it seems nobody used > >>>AF_LOCAL datagrams so far. Weird. The problem is that the > >>>underlying protocol is AF_INET because Windows doesn't support > >>>AF_LOCAL. > >>If you're using UDP as your underlying protocol, UDP already > >>contains a port you can reply to. > >Yes, but the port isn't available to the application which opened a > >AF_LOCAL connection. If recvfrom returns an AF_INET name, it's rather > >tricky to convert it into an AF_LOCAL name for a subsequent sendto call. > > > >[...time passes...] > > > >Or... are you suggesting that recvfrom returns some kind of fake AF_LOCAL > >name, which can be converted back to AF_INET by sendto on the fly? > > Yup, sorry, friday afternoon, not being very good with the explaining thing. > > It's obviously a localhost connection, so we only need a way of > stashing and retrieving the port number, not the host part. Right. That sounds like a reasonable workaround. After all, the sender shouldn't care for the real filename backing the peer socket, it just needs something looking like a AF_LOCAL record to address the peer socket reliably. I think about it, but this will probably not make it into 1.7.18 anymore. Thanks for the hint, Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple