socket connection lost using select function

I'm newbee in socket program. I made my server program with good sample program using select function.

It works well about 20,000 connections over. But, in some case, connection accept twice consequence without receive data from first socket. Only data received from second socket connection. After that, first socket resource cannot release. FD_SET and FD_ISSET are not working with first socket in case of consequence accept I think.

Working clients are 6.

Before this situation, accept, receive data, and close socket, accept, rcv data, close, ...

In case, accept, accept, receive data from second socket, and close second socket. Lost first socket connection.

After that, accept function assign second socket descriptor.

What is problem? How can release fisrt socket?

BR Paul

Read more here:

Content Attribution

This content was originally published by Paul Lee at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: