🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: how to send buffer size message and buffer

#4929
From: Remy Lebeau (TeamB)
Date: Wed, 17 Nov 2004 17:39
23 lines
1852 bytes
"duncan" <no_spam@spamsucks.com> wrote in message
news:419b3068$1@newsgroups.borland.com...

> ClientSocket is using Socket->SendBuf(memory_stream->Memory, (int)size);

Are you checking the return value to SendBuf() to see how many bytes are
actually being sent?  You need to do that if you are not already, because if
SendBuf() doesn't accept the full buffer all at once, you will have to call
SendBuf() again to re-sent the remaining bytes that were not sent.

> However I do not know the size of the incomming buffer.

You should send the buffer's size before sending the actual buffer.  Then
the receiver will know the buffer's size before receiving the actual buffer.

> I have read that this needs to be sent also, however if I send
> this then the ServerSocket OnRead picks up on this also.

As well it should.  That is the way it is supposed to be.


Gambit
Technical Details
Message-ID: <419b8d09$3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!border2.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <419b3068$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,e51687cce2165a07
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: <419b3068$1@newsgroups.borland.com>
Subject: Re: how to send  buffer size message and buffer 
Date: Wed, 17 Nov 2004 09:39:27 -0800
Lines: 25
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: <419b8d09$3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1100713225 68.69.17.41 (17 Nov 2004 09:40:25 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!border2.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail