TCP socket not stable

From: Juan Antonio Giménez (jgimenez_at_siam.es)
Date: 07/20/05


Date: Wed, 20 Jul 2005 11:32:19 GMT

Hi hackers.

I've a thread that manage a TCP socket continously accepting new conecctions
when a client try to connect to my PC. The code is:

bind(SocketServer, (struct sockaddr *)&server_address, server_len);
listen(SocketServer, 10);
while(1) {
        client_len=sizeof(client_address);
        client_sockfd=accept(SocketServer,(struct sockaddr*)&client_address,
(socklen_t*)(&client_len));
        if (client_sockfd!=-1) {
                        ......
        }
}

This code is working correctly but when 15000 seconds aprox don't accept
any client and the access to any file text
return error.

Someone know what's the problem.

Thanks.



Relevant Pages

  • Re: TCP socket not stable
    ... > I've a thread that manage a TCP socket continously accepting new conecctions ... > when a client try to connect to my PC. ... Running out of file descriptors? ...
    (comp.os.linux.development.apps)
  • TCP socket not stable
    ... I've a thread that manage a TCP socket continously accepting new conecctions ... when a client try to connect to my PC. ... This code is working correctly but when 15000 seconds aprox don't accept ...
    (comp.os.linux.development.apps)
  • Re: TCP socket not stable
    ... "Juan Antonio Giménez" wrote: ... > This code is working correctly but when 15000 seconds aprox don't accept ... > any client and the access to any file text ... Kasper Dupont -- der bruger for meget tid pĺ usenet. ...
    (comp.os.linux.development.system)