Hi:

I am writing a program involving a concurrent server that handles client
requests. That is, every time a client connects to the server, the
server that was doing a non-blocking wait on an accept() for new client
connection returns with the file descriptor to handle the new client.

The code looks like this:
if( (newClientFD=accept(serverFD, (struct sockaddr*) &newClientAddress, 
      &addrLength)) < 0 )  
      perror("accept:");

After which I create a new thread and all that jazz.

My problem is this:
This was working perfectly well on my GENTOO box (with gcc 3.2.3 release
3) until I did an $emerge -u ncurses (That did update my gcc to 3.3.2
among other things)

Now, accept() returns two new file descriptors for the first two clients
that make a connection (FDs: 4 and 7), but from then on, accept() gives
an INVALID ARGUMENT error. Why is this happening all of a sudden? Any
clues?

The weird thing is, this used to happen in Red Hat 8.0 as well, the only
difference was that the error would pop up when the first client tried
to establish a connection. With Red Hat 9.0 it works fine.

What could be the problem? Any help will be appreciated.

-- 
Hareesh Nagarajan
Bangalore, India

Try ionicChat today, an Instant Messenger with a difference!
http://puggy.symonds.net/~hareesh/ionic-chat/



--
[EMAIL PROTECTED] mailing list

Reply via email to