🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: stThreadBlocking Vs stNonBlocking confusion

#4507
From: Stefano Bonifazi
Date: Tue, 01 Feb 2005 17:12
43 lines
3202 bytes
Thak You Mr Galema for Your reply!!

"Hans Galema" <notused@notused.nl> wrote in message 
news:41ff691e$1@newsgroups.borland.com...

> OnClientRead is triggered when the internal socket buffer is full
> or when a certain time has elapsed. While your application reads
> the data the socket can receive simultanuously.
>
Very clear now!!:) But let me recap:
- with non-blocking the server socket can receive simultaneously from many 
clients, when one client dedicated buffer is full or when a certain time has 
elapsed the OnClientRead is triggered, but as we have only one thread, only 
one instance of this handler can run in the same time, so the other 
clientsockets have to wait that we finish to process the data ALREADY stored 
in the Socket buffer (that we can get through ReceiveText for example) and 
exit the OnClientRead event handler
- with thread-Blocking multiple instances of the same OnClientRead event 
handler can run at the same time, because of multiple threads, but inside 
them we have to BLOCK the execution WHILE receiving the data

> With this advise I disagree.

Which advice do You refer to?

>One can just use OnRead for a non-blocking
> TClientSocket. There is only one eventhandler: OnRead who decides
> what has to be done. And of course there are no multiple clients at a time
> for a TClientSocket.

Really the threaded version of TClientSocket does not interest me much :) 
... As U say only in the server we have multiple "clients" at the same time!
And if remember well I read somewhere in a previous Newsgroup thread that 
the server has no idea of how the clients works ... so I should be able to 
have a non-blocking Client and a ThreadBlocking server Do I mistake?
The problem is that with the simple test I'm posting in this thread right 
now the Threadblocking server does nothing with my simple non-blocking 
client...Please have a look to it if U have a little time :)

Advising what to use is difficult as it depends
> on what the clientapplication does besides sending and receiving.

You hit the point Mr. Galema ... ThankYou very much!
Technical Details
Message-ID: <41ffb890@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41fe906e@newsgroups.borland.com> <41fe99bf$1@newsgroups.borland.com> <41ff64b9@newsgroups.borland.com> <41ff691e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,4f7607071b9a8537
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Stefano Bonifazi" <stefboombastic@email.it>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <41fe906e@newsgroups.borland.com> <41fe99bf$1@newsgroups.borland.com> <41ff64b9@newsgroups.borland.com> <41ff691e$1@newsgroups.borland.com>
Subject: Re: stThreadBlocking Vs stNonBlocking confusion
Date: Tue, 1 Feb 2005 18:12:49 +0100
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 212.141.203.213
Message-ID: <41ffb890@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1107277968 212.141.203.213 (1 Feb 2005 09:12:48 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail