delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/12/07/15:41:38

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: Winsock
Date: Thu, 7 Dec 2006 20:41:01 -0000
Message-ID: <002901c71a40$03348070$a501a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <4578699D.5040605@comcast.net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On 07 December 2006 19:21, Lucas Charron wrote:

> I can connect to my listening socket from within the
> same process and transmit data to and from the "server" and "client",
> but, if I try to use a web-browser, I get "This connection was denied"
> and the server application has no notification of anything even trying
> to connect. I've checked all of windows' firewall settings (firewall is
> disabled). I've also tryed binding to my external IP and to my loopback.
> I've tryed binding to "0.0.0.0". Somewhere, my connection is being
> rejected. I've checked the windows log files for dropped packets, and
> nothing. I'm at my wits end.
> All sockets functions return normally, there are no errors that windows
> is reporting. This is either a Windows or Cygwin problem, but I can't
> figure it out.

  There is no such thing as a per-process socket, so that can't be the cause
directly.  I suggest you a) look at the netstat output to make sure that the
socket you think is there and listening is valid and b) try to connect with
something simple like telnet or netcat rather than a browser.

  The most likely explanation for this behaviour is that you've got the wrong
endianness somewhere in your code when you setup the inetaddrs.  Within the
same process, you've got the same code, so the server is listening on
whichever numbered port you get if you byteswap (unsigned short)80, and the
client that tries to connect tries to connect to that port, whereas when you
try it with a real browser it tries to get to the real port 80 and finds
nothing there listening.  You must use htonX when entering values directly
into an inetaddr.




    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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