bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TCP Socket's accept function does not return


From: Moncef Mezghani
Subject: TCP Socket's accept function does not return
Date: Tue, 31 May 2005 11:12:47 +0200

Hi everybody,
I wrote a program which create a tcp server socket, call the accept function,
and every-time it returns without error, I fork.
The child process close the server socket and handle the new one.
The main process close the new one, and loop calling the accept function again.
The main process traps and treats the SIGCHLD signal to free every child finishing.

This program works if all tcp connection requests come from the local machine.

In some cases, when tcp connection requests come from outside local-host, and when many requests come in the same time:
1- accept function does not returns,
2- Clients see their socket established, their write done, and loop in waiting responses

The problem disappears:
1- if clients delay their requests,
2- if I introduce a sleep of 0,1 second in my loop before calling the accept function again.
3- If we are working on slow machines.

Somebody has an idea to help?
Is there any parameter to be adjust?

Many Thanks,
Monce Mezghani
address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]