socket programming - accept blocking
Ryan <[email protected]> Wed, 1 Dec 2004 18:30:46 +0000 (UTC)
| Newsgroups | gmane.comp.db.postgresql.cygwin |
|---|---|
| Message-ID | <[email protected]> |
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
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org