🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TWinSocketStream Read in BYTE buffer

#2903
From: Maurice Anderson
Date: Fri, 06 Jan 2006 09:45
50 lines
3641 bytes
> Not only that, but you have introduced bugs into ReadBuf() now. ..

Ok, I see your points and undid my changes.

Couple things that are not clear with me though:

(1)  What chunk sizes does TClientSocket and
       TServerSocket use to send/receive bytes over
       the network? 4K, 8K, 16K, etc?

(2)  What is the transfer speed on say a 100 /mbits LAN?

(3)  What is the limit size in terms of Byes that that the Stream
       can hold?  And once this limit is reached, what happens if
       I don't do a ClientSocket1->Socket->SendBuf(..);

(4)  Using your ReadBuf/writeBuf methods at what point is the
       data considered transfered?  For example on the Client end
       we have: ClientSocket1->Socket->SendBuf(..)  and on the
       server we have: NumRead = Stream->Read(pBuf, BufSize);
       Once Socket->SendBuf returns, is the data considered 'sent'
       over or is it considered sent when we read from the Stream in:
       Stream->Read(pBuf...)?

(5)  Does the whole 25 MB file already exists in the stream ready
       to be written to pBuf (and by extension fully copied from the client)
       or is the ClientSocket holding it's horses ready to transmit another
       chunk as soon as NumRead = Stream->Read(pBuf, BufSize) is completed?

 (6) Pertaining to the sending/receiving of bytes in #4, how can I count
       said bytes transferred  I basically want to add some sort of data
       transfer BYTE counter to let the user know file/data copy progress.

(7)  What is the most efficient BYTE buffer size to allocate for the reading
and
       writing functions for small, medium and large files?  Or does it
matter?
       Currently, I have BYTE rbuf[256];, what happens if I set it to say:
       BYTE rbuf[1024], etc?

(8)  How can I get the Client to open its own thread for sending data?
       I use TServerClientThread to receive connections, but how can I
       use it to open a connection to a server and use it to transmit?

(9)  How can I track each individual connection received on the server
       to say get the source IP address?

(10)  How an I convert a BYTE to binary 1s and 0s?

Thanks
Technical Details
Message-ID: <43be3aac@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43ac3d34$1@newsgroups.borland.com> <43ac6028$1@newsgroups.borland.com> <43acc4c5$1@newsgroups.borland.com> <43ae5b51$1@newsgroups.borland.com> <43aeebe1$1@newsgroups.borland.com> <43aef70e$1@newsgroups.borland.com> <43af06d7$1@newsgroups.borland.com> <43b252fa$1@newsgroups.borland.com> <43b43a5a$1@newsgroups.borland.com> <43b45550$1@newsgroups.borland.com> <43b5a868$1@newsgroups.borland.com> <43b9b1b0$2@newsgroups.borland.com> <43bcedb2$1@newsgroups.borland.com> <43bd69da$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,74cdc31c66b3abd9
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: <43ac3d34$1@newsgroups.borland.com> <43ac6028$1@newsgroups.borland.com> <43acc4c5$1@newsgroups.borland.com> <43ae5b51$1@newsgroups.borland.com> <43aeebe1$1@newsgroups.borland.com> <43aef70e$1@newsgroups.borland.com> <43af06d7$1@newsgroups.borland.com> <43b252fa$1@newsgroups.borland.com> <43b43a5a$1@newsgroups.borland.com> <43b45550$1@newsgroups.borland.com> <43b5a868$1@newsgroups.borland.com> <43b9b1b0$2@newsgroups.borland.com> <43bcedb2$1@newsgroups.borland.com> <43bd69da$1@newsgroups.borland.com>
Subject: Re: TWinSocketStream Read in BYTE buffer
Date: Fri, 6 Jan 2006 01:45:33 -0800
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 64.30.203.223
Message-ID: <43be3aac@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1136540332 64.30.203.223 (6 Jan 2006 01:38:52 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail