Article View: borland.public.cppbuilder.internet.socket
Article #3280Re: Server and Client Sockets
From: Remy Lebeau (TeamB)
Date: Tue, 04 Oct 2005 18:31
Date: Tue, 04 Oct 2005 18:31
28 lines
1809 bytes
1809 bytes
"Paul" <plmacca@clara.co.uk> wrote in message
news:4342c2c8$1@newsgroups.borland.com...
> All of you have mentioned adding a message Q to the
> thread, where can I get info on this?
A message queue is nothing more than calling the Win32 API
Get/PeekMessage(), TranslateMessage() and DispatchMessage() functions in a
loop for the lifetime of the thread. For example:
void __fastcall TMyThread::Execute()
{
MSG msg;
while( GetMessage(&msg, NULL, 0, 0) > 0 )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
void __fastcall TMyThread::TerminateThread()
{
PostThreadMessage(ThreadID, WM_QUIT, 0, 0);
}
Gambit
Technical Details
Message-ID:
<4342ca5a@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!213.239.142.2.MISMATCH!feeder.xsnews.nl!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<433e524d$1@newsgroups.borland.com> <4341ae16$3@newsgroups.borland.com> <4342c2c8$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,dc3706a89a245de9 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: <433e524d$1@newsgroups.borland.com> <4341ae16$3@newsgroups.borland.com> <4342c2c8$1@newsgroups.borland.com> Subject: Re: Server and Client Sockets Date: Tue, 4 Oct 2005 11:31:30 -0700 Lines: 30 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: <4342ca5a@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1128450650 68.69.17.41 (4 Oct 2005 11:30:50 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!213.239.142.2.MISMATCH!feeder.xsnews.nl!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail