Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3D866607.9040707@etr-usa.com> Date: Mon, 16 Sep 2002 17:15:19 -0600 From: Warren Young 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 Subject: Re: socket() function fails when application runs as an NT service. References: <012201c25d4e$4ba8ef70$010310ac AT 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/