🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TWinSocketStream and threading

#3016
From: Maurice Anderson
Date: Tue, 20 Dec 2005 01:43
23 lines
1814 bytes
>For what purpose exactly?  What exactly do you want the code to do?  Please
be more specific.

I am trying to create a simple chat server that can send both text and
files.

> I would suggest moving the creation of the stream outside of the while()

Good point.

>  test = sizeof(pStream); > Why are you doing that?

I mis-understood the nature of the Count option in ReadBuffer.  I thought
doing a sizeof would somehow give me the the number of bytes received.  On
that note, (1)how can I determine how many bytes are being receieved from
the client?  (2)How can I tell the server whether the data is simple text
being received or binary data such as a jpg file?

> You should always catch exceptions by 'const' references:

What's the difference?

Thanks
Technical Details
Message-ID: <43a7619b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!195.92.193.196.MISMATCH!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43a738ea$1@newsgroups.borland.com> <43a75019$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,75fde898af9e336
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Maurice Anderson" <mauriceanderson@hotmail.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <43a738ea$1@newsgroups.borland.com> <43a75019$1@newsgroups.borland.com>
Subject: Re: TWinSocketStream and threading
Date: Mon, 19 Dec 2005 17:43:39 -0800
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 64.30.203.223
Message-ID: <43a7619b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1135042971 64.30.203.223 (19 Dec 2005 17:42:51 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!195.92.193.196.MISMATCH!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail