delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/12/03/04:52:19

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
X-MUA: Microsoft Outlook Express 6.00.2900.2180Produced By Microsoft MimeOLE V6.00.2900.2180
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AqAEAF3lNUlPQhFL/2dsb2JhbACDfVDNb4F3gQg
X-IronPort-AV: E=Sophos;i="4.33,708,1220223600"; d="scan'208";a="111555880"
Message-ID: <003201c9552c$a57b1a00$4001a8c0@mycomputer>
From: "John Emmas" <johne53 AT tiscali DOT co DOT uk>
To: <cygwin AT cygwin DOT com>
Subject: Socket programming with Cygwin
Date: Wed, 3 Dec 2008 09:50:59 -0000
MIME-Version: 1.0
X-IsSubscribed: yes
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

Hi guys,

For the past few weeks I've been struggling to compile a program that uses
sockets.  Actually, the program compiles and builds okay but the client can
never connect to the server.

This morning I found this simple example that implements client/server
socket comms in just a few modules (probably no more than 200 lines of
code, in total).

http://tldp.org/LDP/LG/issue74/tougher.html

I thought this would be a great way to test the process but even this simple
sample won't work under Cygwin (although it builds and works fine under
Linux).

In every case, the programs fail when the client attempts to connect to the
server.  This would be a typical line:-

status = ::connect ( m_sock, ( sockaddr * ) &addr, sizeof ( addr ) );

'status' receives -1 and if I check the error it's invariably something like
"Connection refused" (assume for the sake of argument that the supplied
parameters are valid because the same programs work fine under Linux).

Do I need to enable something in Cygwin for sockets to work?  e.g. should
I have previously run a service using cygrunsrv?  I'm running out of things
to try and there seems to be very little that could go wrong.  I'd be
grateful for any suggestions.  Thanks

John 


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