socket programming - accept blocking

From: Ryan <ryanitus007(at)hotmail(dot)com>
To: pgsql-cygwin(at)postgresql(dot)org
Subject: socket programming - accept blocking
Date: 2004-12-01 18:30:46
Message-ID: loom.20041201T192605-784@post.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-cygwin

I am in the process of learning about socket programming. I am creating a
simple web server that accepts a connection and provides the requested file. I
have tested my code on a true linux machine and it works fine. I am having
problems getting it to work properly in Cygwin.

The faulty segmet of code is:

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

printf("Connection Received\n");

The accept command does not block, so everytime I try to start up the server, I
immediately get the ERROR message.

Like I said, this code works perfectly on a true linux machine, so I was
wondering why it is not working in Cygwin. Does anybody have any suggestions?

Thanks,

Ryan

Browse pgsql-cygwin by date

  From Date Subject
Next Message Asheesh 2004-12-02 10:05:45 Data Migration from version 7.2.1 to version 7.4.3
Previous Message Thomas Hallgren 2004-11-27 22:04:25 Re: how to enable syslog in windows