Hanging at select function call
Posted on 2003-03-25
I am working on a program that forks into 5 separate processes on startup. Afterwhich, each of the process wait for a connection from a client socket and whoever accepts the client connection first handles the communication with the client. My problem is that the program would occasionally hang at the select function. I have called on FD_ZERO and FD_SET before the select function and also I have set the wait time to 10 microsecs. Anyone here has any idea on why the program "hangs" on select? My theory is there could be a possible memory leak in my program but I want to get other feedback. Also, anyone here can suggest what I could do to debug the memory leak? I have tried tracing the code and all my mallocs have corresponding free memory. Any other ideas?
Thanks a lot.