🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Closing TIDTCPServer

#5210
From: Remy Lebeau (TeamB)
Date: Fri, 01 Oct 2004 17:39
17 lines
1474 bytes
"Alfred Thomas" <alfred@fischerint.co.za> wrote in message
news:415d16f4$1@newsgroups.borland.com...

> void __fastcall TForm1::IdTCPServer1Execute(TIdPeerThread *AThread)
> {
>  AnsiString Buffer = AThread->Connection->CurrentReadBuffer();
>  if(!Buffer.IsEmpty()) Memo->Lines->Add(Buffer);
> }

That code is not thread-safe.  The OnExecute event is triggered in the
context of the TIdPeerThread, not the service thread.  You should not be
directly accessing the GUI from worker threads.  You must synchronize that
access.


Gambit
Technical Details
Message-ID: <415d965e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <415c17fa$1@newsgroups.borland.com> <415c407e$1@newsgroups.borland.com> <415d16f4$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,ffbbfefff18a50d0
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: <415c17fa$1@newsgroups.borland.com> <415c407e$1@newsgroups.borland.com> <415d16f4$1@newsgroups.borland.com>
Subject: Re: Closing TIDTCPServer
Date: Fri, 1 Oct 2004 10:39:52 -0700
Lines: 19
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: <415d965e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1096652382 68.69.17.41 (1 Oct 2004 10:39:42 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail