This is more of a Linux socket API question... I have a server thread that
accepts (accept sys call) socket connections and then services a client
request and closes the socket connection using:
shutdown(fd, SHUT_RDWR);
close(fd);
My problem is this... after a while I see that the file descriptor returned
by the accept system call slowly starts increasing. It starts increasing in
the integer file descriptor number returned by the system call (the FD that
we use to do the read and write system calls).
I have two problems:
1) I'm using the file descriptor as an index into a fixed size array
2) I'm scared of eventually running out of file descriptors.
Further more, when I do a "file /proc/PID/fd/XXX" I get a "/proc/PID/fd/XXX:
broken symbolic link to socket:[BLAH]"
Why is this file descriptor still lingering around and how do I get rid of
it when I do a close on the socket?
Thanks
Lee
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs