delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/12/01/14:42:03

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
To: cygwin AT cygwin DOT com
From: Ryan <ryanitus007 AT hotmail DOT com>
Subject: Socket Programming - accept() blocking
Date: Wed, 1 Dec 2004 18:41:37 +0000 (UTC)
Lines: 24
Message-ID: <loom.20041201T193743-430@post.gmane.org>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: main.gmane.org
User-Agent: Loom/3.14 (http://gmane.org/)
X-Loom-IP: 128.211.144.83 (Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1))
X-IsSubscribed: yes

I am trying to learn about socket programming, so I am creating a simple web 
server that receives connections and sends the requested file.  I have a start 
to the code, and this code works fine when built and ran on a true linux 
machine.  However, I have been having trouble getting it to work in Cygwin.

The error occurs in the following lines of code:

    if ((s_curr = accept(s, (struct sockaddr *)  &pin, &addrlen)) == -1) 
    {
        printf("ERROR: accept\n");
    }

    printf("Connection Received\n");

The accept() command is not blocking, so as soon as I attempt to start the web 
server, it immediately returns the ERROR message.

Like I said, this code works fine on a true linux machine, so I was wondering 
if anybody had any suggestions as to why Cygwin is not blocking for this accept 
call.

Thanks,

Ryan


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