🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Client / Server Socket....

#3532
From: Paul
Date: Fri, 19 Aug 2005 08:32
34 lines
2113 bytes
In examples I have had before on using BCB server and client components, the 
spawned server socket thread either waits for data, or transmits data.  This 
doesn't seem to aid an asynconous protocol, as depending how long you are 
prepared to wait can delay transmitting data.

Does this mean the BCB components don't cater for a fully async messaging 
system?  Are there components that do, or anything in the BCB VCL library 
that will?

Thanks

Paul

//---------------------------------------------------------------------------
//- Execute Thread
void __fastcall CMyServerThread::ClientExecute(void)
{
    // result of any operation should close the socket
    bool result = true;
    // create stream
    TWinSocketStream *pStream = new TWinSocketStream( ClientSocket, 5000 );

    try
    {
        while( (!Terminated) && (ClientSocket->Connected) )
        {
            if (result)
            {
                if( pStream->WaitForData(1000) )
                {
                    int iLength = 0;

                    result = Read(pStream, &iLength, sizeof(iLength));
                    ........
Technical Details
Message-ID: <43058ac8$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,c4f84c0147b64fb7,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Paul" <plmacca@clara.co.uk>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Client / Server Socket....
Date: Fri, 19 Aug 2005 08:32:57 -0000
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 81.129.155.62
Message-ID: <43058ac8$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1124436680 81.129.155.62 (19 Aug 2005 00:31:20 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail