Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <3D866607.9040707@etr-usa.com>
Date: Mon, 16 Sep 2002 17:15:19 -0600
From: Warren Young <warren@etr-usa.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Cygwin-L <cygwin@cygwin.com>
Subject: Re: socket() function fails when application runs as an NT service.
References: <Pine.GSO.4.44.0209160238580.21486-100000@slinky.cs.nyu.edu> <012201c25d4e$4ba8ef70$010310ac@lyoncleitienne>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Christophe LEITIENNE wrote:
>>
> I think 0 is a valid socket descriptor. -1 is not.

True.

It may also be helpful to call WSAGetLastError().  I realize that you're 
probably running under Cygwin for POSIX compatibility, but adding this 
temporarily to ask Winsock "why" it returned an error can be 
illuminating.  Since one possible result is "there is no error", you 
will want to call WSASetLastError() with 0 to make sure you don't get an 
older error code, since Winsock doesn't reset the error variable after a 
successful call.
-- 
= Winsock Programmer's FAQ: http://tangentsoft.net/wskfaq/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

