Article View: borland.public.cppbuilder.internet.socket
Article #5049Re: TCP Timeout
From: Remy Lebeau (TeamB)
Date: Tue, 26 Oct 2004 20:31
Date: Tue, 26 Oct 2004 20:31
33 lines
2064 bytes
2064 bytes
"Drew" <aemsley@brightwell.org.uk> wrote in message news:417eaff4@newsgroups.borland.com... > If the client does not disconnect cleanly, the TCP connection > remains established and does not appear to timeout. Yes, it will time out eventually. It may take a long time, simply because the underlying socket stack itself (WinSock on Windows) can't detect abnormal disconnects in any timely fashion, but it will eventually time out internally and decide the socket is no longer valid. > When the number of connections reaches the maximum allowed by the > TIdTCPServer (48), it quite rightly rejects all other attempts to reconnect. Correct. > 1. What controls the TCP timeout period? The socket stack itself and its internal configurations. > 2. What is the best way of the TCP Server detecting failed > connections in this way? Implement your own pinging type of system in your communications. Have your clients send a small packet to the server periodically (if not sending actual data for awhile) so that the server knows the connection is still alive. If you do not receive any data after so much time, simply assume the client is gone and close the connection yourself. Gambit
Technical Details
Message-ID:
<417eb3d1$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<417eaff4@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,e7285fc7a0e415b7 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <417eaff4@newsgroups.borland.com> Subject: Re: TCP Timeout Date: Tue, 26 Oct 2004 13:31:00 -0700 Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <417eb3d1$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1098822609 68.69.17.41 (26 Oct 2004 13:30:09 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail