From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58112 invoked by alias); 24 Sep 2017 09:49:39 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 57865 invoked by uid 89); 24 Sep 2017 09:49:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.3 required=5.0 tests=AWL,BAYES_60,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=RPC, adress, windowspcs, clnt_call X-HELO: m0.truegem.net Received: from m0.truegem.net (HELO m0.truegem.net) (69.55.228.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 24 Sep 2017 09:49:36 +0000 Received: (from daemon@localhost) by m0.truegem.net (8.12.11/8.12.11) id v8O9nZXC080367 for ; Sun, 24 Sep 2017 02:49:35 -0700 (PDT) (envelope-from mark@maxrnd.com) Received: from 76-217-5-154.lightspeed.irvnca.sbcglobal.net(76.217.5.154), claiming to be "[192.168.1.100]" via SMTP by m0.truegem.net, id smtpdp4ih0t; Sun Sep 24 02:49:25 2017 Subject: Re: RPC clnt_create() adress already in use To: cygwin@cygwin.com References: <59D90AF8D70E9740907BACDE2BCB5208365F7F6C@RESW102.resdom01.local> From: Mark Geisert Message-ID: <4c0d1ba5-d314-744b-e094-80e540c9203a@maxrnd.com> Date: Sun, 24 Sep 2017 09:49:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: <59D90AF8D70E9740907BACDE2BCB5208365F7F6C@RESW102.resdom01.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00219.txt.bz2 PAULUS, Raimund, TI-ABN wrote: > In our environment we have a Linux-Server and several Windows-PCs (Windows XP SP3, in the past Windows NT too). On the Linux-Server RPC-Services (Remote Procedure Call) are running, one service for one Windows-PC each. To build the RPC-clients on the Windows-boxes, I used Cygwin 1.5.18 and actually Cygwin 2.5.1 (because we now have Windows 7 too). > > The RPC-Client (*.exe) on the Windows-box is started at any time by hand, establishes a connection to the server (clnt_create), executes a few calls to the server (clnt_call), closes the connection (clnt_destroy) and exits. The time-interval between the program starts can be 10 seconds up to 2 minutes. > > This worked over many years without any error (Cygwin 1.5.18). > Now I upgraded to Cygwin 2_5_1 (libtirpc instead librpc) and there are problems. Sometimes the RPC-Client cannot establish a connection to the server. The error message from clnt_spcreateerror(): > > Remote system error - Address already in use > > I think it is "EADDRINUSE". I can only answer generally as I haven't tried your testcase and don't know anything about either RPC library on Cygwin. If EADDRINUSE is the error you're getting, it might be due to a difference between libtirpc and the older librpc. When a program binds a specific address and port to a socket, uses the socket then later closes it, the system keeps the tuple in a "locked" state until enough time has passed for the other end of the connection to notice the connection's been closed. During that time, attempting to bind() with the same address and port will result in EADDRINUSE. It's a TCP/IP safety mechanism. If you wish to override that behavior, you set a specific option SO_REUSEADDR on the socket with setsockopt() before you issue the bind(). Perhaps libtirpc is not doing that, though librpc was doing that. Only way to know is to examine the source to both libraries. It's possible an strace of a broken session compared to an strace of a working session might shed some light. ..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