🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Blocking Client

#4532
From: Remy Lebeau (TeamB)
Date: Thu, 20 Jan 2005 20:37
33 lines
1877 bytes
"mike" <mfbrowne@earthlink.net> wrote in message
news:41f00ec6$1@newsgroups.borland.com...

> 1- Is there an example around that I could study to see how this is done.

Go to http://www.deja.com and do a search.  Same code has been posted many
times before.

> - Set the Client Socket to Blocking.

Yes.

> - Once I have established a connect to the server, create my
> own thread that will do my reading of any data being received.

A thread is not strictly required.  Typically, a thread is only used when
you want to process data asynchronously, usually because you do not know
when data will be arriving.  But if you are sending data, then reading a
response, for instance, then you don't need to use a thread, unless such
operations will block other code from working properly.

> I do this using the WinSocketStream and the method
> WaitForData() - from this thread then process the message.

Yes.

> 3- For writing to the socket, do I need to have a separate thread.

No.


Gambit
Technical Details
Message-ID: <41f015df$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41f00ec6$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,8975bc0a9ed70a81
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <41f00ec6$1@newsgroups.borland.com>
Subject: Re: Blocking Client
Date: Thu, 20 Jan 2005 12:37:05 -0800
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <41f015df$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1106253279 68.69.17.41 (20 Jan 2005 12:34:39 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail