🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Client / Server Socket....

#3535
From: Paul
Date: Sat, 20 Aug 2005 08:25
38 lines
2258 bytes
> I have implemented asynchronous protocols using server threads.  They work
> fine.

Is that using blocking or unblocking modes?

>> as depending how long you are prepared to wait can delay transmitting
> data.
>
> Not necessarily.
>

If using blocking mode and spawning threads, what is a reasonable "wait for 
data" time to avoid a delay in trasmitting? 10ms?
I have heard from other engineers (not using BCB), that they have written 
async protocols by having a socket for Rx and a socket for Tx.  Have you 
used such an approach?  Any drawbacks or advantages?

> They do, if you use them in non-blocking mode.  Then you don't need 
> threads.
> But then you can only process data as fast as you can process queued
> messages.

Just to confirm, if using non-blocking and no threads, the "on socket read" 
and "on socket write" events are async?

Last two questions (sorry to be annoying):

1)  Is it ok to instantiate the server and client components in a thread, if 
so, can it be done like this:
        Ssocket = new TServerSocket(NULL);

2)  Is there a property to restrict the number of clients the server 
component can accept, if not, whats the sequence the server events should go 
through to reject the connection?

Thanks

Paul.
Technical Details
Message-ID: <4306da89@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43058ac8$1@newsgroups.borland.com> <4306110f$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,c4f84c0147b64fb7
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Paul" <plmacca@clara.co.uk>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <43058ac8$1@newsgroups.borland.com> <4306110f$1@newsgroups.borland.com>
Subject: Re: Client / Server Socket....
Date: Sat, 20 Aug 2005 08:25:38 -0000
Lines: 40
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; Original
NNTP-Posting-Host: 81.129.96.111
Message-ID: <4306da89@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1124522633 81.129.96.111 (20 Aug 2005 00:23:53 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail