From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#23615: 25.1.50; Which platforms can safely use getsockopt(,,SO_ERROR,,)? Date: Sat, 28 May 2016 13:18:27 -0400 Message-ID: <8906f53e-95c4-cf5d-0e93-56a9f080a1ea@cornell.edu> References: <8337p63y2a.fsf@gnu.org> <8080c018-3cc8-c97e-0654-dc98be95a7ef@cornell.edu> <83twhixrvn.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1464455964 28347 80.91.229.3 (28 May 2016 17:19:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 May 2016 17:19:24 +0000 (UTC) Cc: 23615@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 28 19:19:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b6htI-0006Ch-Ac for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 May 2016 19:19:12 +0200 Original-Received: from localhost ([::1]:53750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6htH-0004qs-3w for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 May 2016 13:19:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6htB-0004pj-9X for bug-gnu-emacs@gnu.org; Sat, 28 May 2016 13:19:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6ht8-0007E6-3P for bug-gnu-emacs@gnu.org; Sat, 28 May 2016 13:19:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6ht7-0007E2-WF for bug-gnu-emacs@gnu.org; Sat, 28 May 2016 13:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b6ht7-0008Cz-NF for bug-gnu-emacs@gnu.org; Sat, 28 May 2016 13:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 May 2016 17:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23615 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23615-submit@debbugs.gnu.org id=B23615.146445591631522 (code B ref 23615); Sat, 28 May 2016 17:19:01 +0000 Original-Received: (at 23615) by debbugs.gnu.org; 28 May 2016 17:18:36 +0000 Original-Received: from localhost ([127.0.0.1]:44994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6hsi-0008CM-Eq for submit@debbugs.gnu.org; Sat, 28 May 2016 13:18:36 -0400 Original-Received: from limerock04.mail.cornell.edu ([128.84.13.244]:51357) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6hsg-0008C9-RC for 23615@debbugs.gnu.org; Sat, 28 May 2016 13:18:35 -0400 X-CornellRouted: This message has been Routed already. Original-Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock04.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id u4SHISdo029119; Sat, 28 May 2016 13:18:29 -0400 Original-Received: from [192.168.1.3] (mta-68-175-148-36.twcny.rr.com [68.175.148.36] (may be forged)) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id u4SHIRXU027327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 28 May 2016 13:18:28 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 In-Reply-To: <83twhixrvn.fsf@gnu.org> X-PMX-Cornell-Gauge: Gauge=XXXXX X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118813 Archived-At: On 5/28/2016 8:57 AM, Eli Zaretskii wrote: >> From: Ken Brown >> Test program attached. It simulates the situation of bug 23606 (before >> the bug was fixed). Here's what happens on Cygwin: >> >> $ gcc -o socket_test socket_test.c >> >> $ ./socket_test.exe >> Server listening on port 50176. >> Attempting client connection...failure: Connection refused. > > With MinGW, I get this instead: > > D:\usr\eli\data>socket_test > Server listening on port 2213. > Attempting client connection...success. > > Do we have to have a failure in this case? Or is the above a valid > outcome? It's a valid outcome. I think the reason the connection is refused on Cygwin (and apparently on RHEL 7.2) is that the first addrinfo structure returned by getaddrinfo has an IPv6 address. There's no reason to expect this to happen on all platforms. > Of course, I needed to hack the code quite a lot to get it compile on > MS-Windows; the result is attached below. Maybe I broke the code > while doing that? No, you didn't. I get the same results as before with your version, after fixing a couple of typos that don't affect the MinGW build. (You forgot a semicolon at the end of line 41, and you misspelled "strerror" in line 126.) > (I don't think calling 'connect' after 'listen' is supposed to work; > on Windows it predictably fails with EINVAL, as documented on MSDN.) I think on Posix systems it fails with EISCONN. I put the call in because it's done in the code in process.c that I was imitating, but omitting it as you did is fine also. Thanks for testing. Ken