🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: stThreadBlocking Vs stNonBlocking confusion

#4506
From: Hans Galema
Date: Tue, 01 Feb 2005 11:32
36 lines
2532 bytes
Stefano Bonifazi wrote:

> My needs are that the server can send or receive those big files at the same 
> time without one client sitting while waiting for others!

A TServerSocket can receive big files simultanuously from many clients.
Both in blocking and non-blocking mode.

A TServerSocket can send big files simultanuously to many clients.
Both in blocking and non-blocking mode.

All things need programming.

> that is the OnClientRead is triggered once the socket has finished to 
> receive, Do I mistake? 

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.

>>>Why should I use the threaded way for a TClientSocket?
>>
>>Easier coding of the socket operations (your code does not have to be
>>separated amongst multiple event handlers), simultaneous processing of
>>multiple clients at a time, etc.
>>
> I always thought that one of the most important features of BCB vs VC was 
> the clearness due to the events handlers ...

With this advise I disagree. 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. Advising what to use is difficult as it depends
on what the clientapplication does besides sending and receiving.

Hans.
Technical Details
Message-ID: <41ff691e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41fe906e@newsgroups.borland.com> <41fe99bf$1@newsgroups.borland.com> <41ff64b9@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
Date: Tue, 01 Feb 2005 12:32:37 +0100
From: Hans Galema <notused@notused.nl>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: stThreadBlocking Vs stNonBlocking confusion
References: <41fe906e@newsgroups.borland.com> <41fe99bf$1@newsgroups.borland.com> <41ff64b9@newsgroups.borland.com>
In-Reply-To: <41ff64b9@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.201.248
Message-ID: <41ff691e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1107257630 129.125.201.248 (1 Feb 2005 03:33:50 -0800)
Lines: 36
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail