Article View: borland.public.cppbuilder.internet.socket
Article #4584Re: [Indy 9.018 / CBuilder6] IdTCPServer Connection always NULL
From: Remy Lebeau (TeamB)
Date: Fri, 14 Jan 2005 23:37
Date: Fri, 14 Jan 2005 23:37
37 lines
2294 bytes
2294 bytes
"Zoetjuh" <peter@i-hate-spam.zoetjuh.demon.nl> wrote in message
news:41e84d3b@newsgroups.borland.com...
> Check http://www.zoetjuh.demon.nl/isnull.jpg
> It's there... :(
It is simply not possible for the Connection to be NULL. Look at the source
code for TIdThread and TIdPeerThread. The Connection is assigned, then
OnExecute is called in a loop, then the Connection is freed. There is
nothing that frees the Connection while OnExecute is still looping. In
fact, it is not possible for OnExecute to be triggered with a NULL
Connection because the Connection object is used to trigger the OnExecute
event in the first place, so the Connection is always guaranteed to be
valid:
procedure TIdPeerThread.Run;
begin
//...
if not Connection.Server.DoExecute(Self) then begin // <-- non-NULL
Connection!!!
//...
end;
function TIdTCPServer.DoExecute(AThread: TIdPeerThread): boolean;
begin
//...
Result := Assigned(OnExecute);
if Result then begin
OnExecute(AThread); // <-- OnExecute triggered by accessing
non-NULL Connection!!!
end;
//...
end;
Gambit
Technical Details
Message-ID:
<41e85726@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!proxad.net!proxad.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-mailReferences:
<41e80f47@newsgroups.borland.com> <41e81519$1@newsgroups.borland.com> <41e84d3b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,8d17184a33491515 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: <41e80f47@newsgroups.borland.com> <41e81519$1@newsgroups.borland.com> <41e84d3b@newsgroups.borland.com> Subject: Re: [Indy 9.018 / CBuilder6] IdTCPServer Connection always NULL Date: Fri, 14 Jan 2005 15:37:01 -0800 Lines: 39 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: <41e85726@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1105745702 68.69.17.41 (14 Jan 2005 15:35:02 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!proxad.net!proxad.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