delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/02/05/03:19:40

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; q=dns; s=default; b=XuA
qSs28xQPifX6gbBLn58OPJlPFzoA/lYan+dYIKDsa5rE3svwoX1ESyqDYbikx/Ky
1Kh+Wkzk8my5Cbq5XkEj4S2F3h0SzI03pF+Yt4mCN25ZI1jnJFWuYuhFHEXDDw7I
fSyNuTCEXA24/fTbWjJY+zw71iqlFHY05gysnmGk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; s=default; bh=U0fHziwdx
L77+h8fCkHq2h1BvCA=; b=G2iAfelqE+SdKhbgp3agagNVw9yWqwDbP8+mBd6Zb
PWLtn4w+0H1sKySP0PDFIeeFgsvl6qYhEp+sr6TNlZ6NBz0Ujk6icnKDJ+75XP6s
JEtJgexUFZMA3e3DeDA6bXiFKNoX94XOBV4nFFODBT5pfbOahK4Uf/USZycUJeAm
ls=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,CYGWIN_OWNER_BODY,GIT_PATCH_2,KAM_INFOUSMEBIZ,KAM_LAZY_DOMAIN_SECURITY,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=H*M:local, H*MI:local, H*F:D*biz, friday
X-HELO: mailrelay.dillinger.de
From: "PAULUS, Raimund, TI-ABN" <Raimund DOT Paulus AT dillinger DOT biz>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: RPC clnt_create() adress already in use
Date: Mon, 5 Feb 2018 08:19:21 +0000
Message-ID: <59D90AF8D70E9740907BACDE2BCB520836E325EF@RESW102.resdom01.local>
MIME-Version: 1.0
X-IsSubscribed: yes
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id w158Jcet028902

Hello Mark,

unfortunately i must correct my statement from Friday.
The program works, but only if the connections to the server are established in a loop inside the program.
If the program ends and you start it anew, a connection is not possible for a long time. you have to wait before you can establish a new connection.

Actually only our approaches in the original bindresvport() seem to work for all cases.
You have proposed to use the static variable usecount in bindresvport(). But how is the value of the variable handled if the program starts anew. Is it possible to get an used portnumber 
and run in EADDRINUSE?

Greetings
Raimund

-----Ursprüngliche Nachricht-----
Von: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] Im Auftrag von PAULUS, Raimund, TI-ABN
Gesendet: Freitag, 2. Februar 2018 13:58
An: cygwin AT cygwin DOT com
Betreff: Re: RPC clnt_create() adress already in use

Hi Mark,

it works. Maybe it's the best solution for the problem.

Greetings

Raimund


-----Ursprüngliche Nachricht-----
Von: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] Im Auftrag von Mark Geisert
Gesendet: Freitag, 2. Februar 2018 09:11
An: cygwin AT cygwin DOT com
Betreff: Re: RPC clnt_create() adress already in use

Mark Geisert wrote:
> Corinna Vinschen wrote:
>> On Jan 31 00:15, Mark Geisert wrote:
>>> PAULUS, Raimund, TI-ABN wrote:
>>>> Hi Mark,
>>>>
>>>> in my email
>>>> (https://sourceware.org/ml/cygwin/2017-12/msg00194.html) i described 2 approaches. I prefer  nr 1.
>>>> Here the part of the source in bindresvport.c:
>>>> [...]
> [...]
>>
>> I'm a bit puzzled here in terms of using your own bindresvport.  
>> Cygwin implements bindresvport{_sa} for quite some time, 2006 or earlier.
>
> Yeesh; I did not know that.  Thanks for pointing that out. So that 
> means there's another possible way to try solving the OP's issue: by 
> using Cygwin's
> bindresvport* in place of the one supplied with libtirpc.
>
> If we see the OP's issue with Cygwin's bindresvport*, I think it makes 
> more sense to patch libtirpc than to change Cygwin's bindresvport*.
> The crux of OP's issue is that libtirpc's code expects to see 
> EADDRINUSE errors from bind() whereas on Cygwin they aren't often seen until you connect().
>
> I'll look into using Cygwin's bindresvport() in the next day or two.

My testing shows that OP's original issue goes away when libtirpc is compiled to use Cygwin's bindresvport() directly rather than using its own version of that function.

Raimund, could you try this newest possible solution?  Before the first #include in bindresvport.c, add the line
     #ifndef __CYGWIN__
and at the end of the file, add the line
     #endif
Then rebuild your libtirpc and your test programs linking against it, then run your tests.  If this proves to solve your original problem then I'll submit a patch of libtirpc to the Cygwin package maintainer.

Thank you,

..mark


--
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


--
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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019