niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » Linux » networking
socket call does not read full content
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
Author Message
jainarunk@gmail.com
*nix forums beginner


Joined: 10 May 2006
Posts: 18

PostPosted: Tue Jul 18, 2006 3:27 pm    Post subject: socket call does not read full content Reply with quote

Hello Group,

I am implementing a http client and reading the content from the
socket. For MIME type

text/html the socket reads the full Content-Length bytes, however if
the MIME type is
audio/mpeg the socket does not read the whole Content-Length and only
reads some number
of less bytes from the web server.

It causes my program to go in an infinite loop, because I close the
socket when I read full
Content-Length.

Could someone tell me what could be causing this. I tried to debug it
in many ways but
could not come up with a reason.

Need help in figuring out the cause.

Thanks in advance.

nagrik
Back to top
Allen McIntosh
*nix forums Guru Wannabe


Joined: 22 Mar 2005
Posts: 160

PostPosted: Tue Jul 18, 2006 3:37 pm    Post subject: Re: socket call does not read full content Reply with quote

jainarunk@gmail.com wrote:
Quote:
I am implementing a http client and reading the content from the
socket. For MIME type

text/html the socket reads the full Content-Length bytes,

You were lucky. You will get however many bytes are available at the
time of the read. If the content is split over several frames, you may
not get everything in a single call.
Back to top
jainarunk@gmail.com
*nix forums beginner


Joined: 10 May 2006
Posts: 18

PostPosted: Tue Jul 18, 2006 4:09 pm    Post subject: Re: socket call does not read full content Reply with quote

Allen McIntosh wrote:
Quote:
jainarunk@gmail.com wrote:
I am implementing a http client and reading the content from the
socket. For MIME type

text/html the socket reads the full Content-Length bytes,

You were lucky. You will get however many bytes are available at the
time of the read. If the content is split over several frames, you may
not get everything in a single call.

Allen,

I am making several calls, till I count all bytes and total is equal to
Content-Length.
However after reading some 21 bytes less, the client does not have
anything to read
although expecting 21 more bytes and thus the client goes in an
infinite loop.

nagrik
Back to top
Davide DG
*nix forums beginner


Joined: 27 Jun 2005
Posts: 4

PostPosted: Tue Jul 18, 2006 6:57 pm    Post subject: Re: socket call does not read full content Reply with quote

jainarunk@gmail.com ha scritto:
Quote:
I am making several calls, till I count all bytes and total is equal to
Content-Length.
However after reading some 21 bytes less, the client does not have
anything to read
although expecting 21 more bytes and thus the client goes in an
infinite loop.

I'd suggest using a packet sniffer (eg: ethereal).
bye.

--
Davide DG.
tieni per te la spam per rispondermi via email.
Back to top
Mike T.
*nix forums Guru Wannabe


Joined: 20 Feb 2005
Posts: 245

PostPosted: Wed Jul 19, 2006 7:55 pm    Post subject: Re: socket call does not read full content Reply with quote

Davide DG wrote:

Quote:
I'd suggest using a packet sniffer (eg: ethereal).

Ethereal is dead Wink
Back to top
þó¡ÿ-Þõ!ý m@ñ
*nix forums Guru Wannabe


Joined: 04 Apr 2005
Posts: 107

PostPosted: Thu Jul 20, 2006 1:14 am    Post subject: Re: socket call does not read full content Reply with quote

Spoon wrote:
Quote:
Davide DG wrote:

I'd suggest using a packet sniffer (eg: ethereal).

Ethereal is dead Wink

I use ethereal, therefore I am dead?

Hey, wait a minute!

poly-p man
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
The time now is Thu Nov 20, 2008 11:37 pm | All times are GMT
navigation Forum index » *nix » Linux » networking
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Artica-postfix a full Open Source postfix management console dtouzeau Postfix 0 Mon Jun 16, 2008 9:46 pm
No new posts turn off autoreply when mailbox full bxd20 Postfix 1 Mon Mar 03, 2008 9:55 pm
No new posts how can i use fstream object to clear file's content? horneye C++ 2 Fri Jul 21, 2006 7:52 am
No new posts can I call a internal function directly? minrobin@gmail.com shell 2 Fri Jul 21, 2006 2:17 am
No new posts SOAP::Lite and complex client call parameter gelbeiche Perl 0 Thu Jul 20, 2006 7:37 pm

Loans | Computeach | Society 2007 | Debt Consolidation | Secured Loans
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1897s ][ Queries: 16 (0.1101s) ][ GZIP on - Debug on ]