🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

{ctNonBlocking, ctBlocking} and {stNonBlocking, stThreadBlocking}

#5500
From: Vladimir Stefanovic
Date: Fri, 13 Aug 2004 19:52
55 lines
2602 bytes
Hi,

I have some basic questions about propper usage of...

ClientType: ctNonBlocking & ctBlocking
ServerType: stNonBlocking & stThreadBlocking

...for TServerSocket and TClientSocket, and some other
related questions.

1) Is TMemoryStream appropriate container for the date that has
to be sent on client side and received on the server side? If
not, what is the adequate one?

2) If I want to send 100 KB of data from a client to server, and
that't the only connection (only one client to connect to the server)
what should I use for a ClientType and what for a ServerType.

   a) What technique of sending should I use for this?

   b) What mechanism for catching messages should I use for that?
   Is TClientSocket::OnError() & TServerSocket::OnClientError()
   enough (for writing in a log for example)?

   c) When some error occur while process of sending data, is
   some kind of immediate retry of the whole process of any sense?

   d) How can I know that the data has been sent successfuly
   in this case?

3) When sending up to 100 bytes of ASCII string from only one
client to server, should I use SendText() insted of SendBuf()?

   a) Why SendBuf() is usualy recomended one?

   b) Should I use the same ClientType and ServerType like in
   point 2 ?

4) If I have two (or more) clients that in some moment (mabe the
same) wants to send the data (max 20 KB) to the client what
ClientType and ServerType should I then use?

   a) What technique of sending should I use? (I think maybe of
   TWinSocketStream).

   b) How can I know that the data has been sent successfuly
   in this case?


Any code, pseudo, link, and similar would be of great help.



Best regards,
Vladimir Stefanovic
Technical Details
Message-ID: <411d1c29@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,4c45334fb8a0a6bb,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Vladimir Stefanovic" <spam@not.needed>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: {ctNonBlocking, ctBlocking} and {stNonBlocking, stThreadBlocking}
Date: Fri, 13 Aug 2004 21:52:58 +0200
Lines: 58
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: 213.137.116.204
Message-ID: <411d1c29@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1092426793 213.137.116.204 (13 Aug 2004 12:53:13 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail