🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Problem with recv

#1242
From: Remy Lebeau (TeamB)
Date: Fri, 23 Feb 2007 03:36
25 lines
1836 bytes
"Eduardo Jauch" <eduardo.jauch@gmail.com> wrote in message
news:45de3b88@newsgroups.borland.com...

> I'm read on another forum exactly the oposite... Now I'm in doubt...

Your code wants to transmit 59 bytes (61 after you add the necessary
CRLF) to the server, but you are telling send() to transmit 5999 bytes
instead.  That is completely wrong, and whoever told you otherwise is
lying.

> Sizeof will return 4000 to me...

As it should be.  That is what it is supposed to do.  But that is not
the correct size to use.

> If the buffer is empty (full of '\0'), strlen will return 4000 too?

No, it will not.  It will return the actual length of the character
data, up to but not including the first '\0' byte.  If the buffer is
completely empty, it will return 0.  When you put your string data in
it, it will return 59/61 instead.


Gambit
Technical Details
Message-ID: <45de613a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45de060c$1@newsgroups.borland.com> <45de1497$1@newsgroups.borland.com> <45de3b88@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f4676ab8bfe79c79
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: <45de060c$1@newsgroups.borland.com> <45de1497$1@newsgroups.borland.com> <45de3b88@newsgroups.borland.com>
Subject: Re: Problem with recv 
Date: Thu, 22 Feb 2007 19:36:45 -0800
Lines: 27
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: 75.83.34.171
Message-ID: <45de613a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1172201786 75.83.34.171 (22 Feb 2007 19:36:26 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail