🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4837

Re: Detecting a client disconnect

#4837
From: Remy Lebeau (TeamB)
Date: Wed, 24 Nov 2004 19:00
30 lines
2054 bytes
"Paul Machiaverna" <paul.machiaverna@i-stat.com> wrote in message
news:41a4aed9$3@newsgroups.borland.com...

> In the OnExecute handler method, there is the following code (fragment)
>
> while ( true )

Do *not* run your own loop in the OnExecute event.  The OnExecute event
itself is already looped by TIdTCPServer.  By running your own loop, you are
preventing TIdTCPServer from performing housekeeping on the socket between
loop iterations.

>   // If the socket is no longer connected,
>   if ( !AThread->Connection->Connected() )

There is no need to check that.  TIdTCPServer already does that for you.

>  // Perform reads/writes.

You did not show that code.  I want to make sure that you are not preventing
TIdTCPServer from managing the socket properly.

> Other info:  INDY 9.0.14, WinXP Pro Version 2002 SP1

9.0.14 is an old version of Indy.  You should upgrade to the current
development snapshot.


Gambit
Technical Details
Message-ID: <41a4d9d0$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.zanker.org!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41a3a222$1@newsgroups.borland.com> <41a3a429@newsgroups.borland.com> <41a4aed9$3@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,2bbc0c2eefeb0788
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: <41a3a222$1@newsgroups.borland.com> <41a3a429@newsgroups.borland.com> <41a4aed9$3@newsgroups.borland.com>
Subject: Re: Detecting a client disconnect
Date: Wed, 24 Nov 2004 11:00:33 -0800
Lines: 32
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: <41a4d9d0$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1101322704 68.69.17.41 (24 Nov 2004 10:58:24 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.zanker.org!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail