High Corinna, is it possible to get the patched cygwin1.dll for Cygwin 2.5.1? I have to support several older Win XP SP3 boxes. Raimund -----Ursprüngliche Nachricht----- Von: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] Im Auftrag von Corinna Vinschen Gesendet: Dienstag, 6. Februar 2018 15:20 An: cygwin@cygwin.com Betreff: Re: RPC clnt_create() adress already in use On Feb 6 11:29, PAULUS, Raimund, TI-ABN wrote: > On Feb 5 15:06, Corinna Vinschen wrote: > > On Feb 5 14:34, Corinna Vinschen wrote: > > > On Feb 5 12:26, Corinna Vinschen wrote: > > > > [...] > > > > What potential solutions to this problem do we have? > > > > > > > > - bindresvport could enforce SO_EXCLUSIVEADDRUSE temporarily to make > > > > sure bind fails. > > > > > > Nope, no way. Even enforcing SO_EXCLUSIVEADDRUSE results in the > > > second bind succeeding and the subsequent connect failing. The > > > entire SO_REUSEADDR/SO_EXCLUSIVEADDRUSE semantics only works as > > > desired on the server side apparently > > > > > > > - bindresvport could check every local address for being free prior > > > > to calling bind. However, there's a potential race here. > > > > > > > > - DisconnectEx? Never tried this Winsock extension but it might be > > > > worth a shot. > > > > I think I have a very simple solution for the scenario which calls > > bindresvport with port number. Still looking for a solution for the > > second problem... > > I've pushed a few patches and uploaded new developer snapshots to > https://cygwin.com/snapshots. Please give them a try. > > with the snapshot of cygwin1.dll and using bindresvport() from Cygwin > for libtirpc (instead of the original bindresvport() from libtirpc) > all my testcases work without error. > > Many thanks > Raimund Thanks for testing. Please note that this should work most of the time, but is still not 100% foolproof. There's a systematic race between checking existing connections and calling bind which can't be easily worked around by Cygwin. Still, should be better than before :} Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat ТÒÐÐ¥&ö&ÆVÒ&W÷'G3¢‡GG¢òö7–wv–âæ6öÒ÷&ö&ÆV×2æ‡FÖÀФd¢‡GG¢òö7–wv–âæ6öÒöfðФFö7VÖVçFF–ö㢇GG¢òö7–wv–âæ6öÒöFö72æ‡FÖÀÐ¥Vç7V'67&–&R–æfó¢‡GG¢òö7–wv–âæ6öÒöÖÂò7Vç7V'67&–&R×6–×ÆPРÐ