Re: partial receive in socket recv() issue for large response
- From: "Chris Becke" <chris.becke@xxxxxxxxx>
- Date: Thu, 28 Sep 2006 11:27:38 +0200
um, tcp will buffer packets... so you should be able to recieve as much as
the current value of SO_RCVBUF (see setsockopt) in a single call to recv
with a stream socket. I think the default is 8kb but dont quote me as
authorative :P
"Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx> wrote in message
news:ObUYdLt4GHA.3452@xxxxxxxxxxxxxxxxxxxxxxx
As addition to Dave's message :is
You will never receive such buffer at one read, because MTU of ethernet
1500 bytes - the max number NIC send to peer at oncecall
Arkady
"Dave Lowther" <davel@xxxxxxxxx> wrote in message
news:u%23eEuYs4GHA.696@xxxxxxxxxxxxxxxxxxxxxxx
"NAGA" <NAGA@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
<snip>
While debugging application following steps are successful.
-iStatus is valid for a large return value (72007 bytes) in following
AnotheriStatus = recv(sock, &Response[BufIdx], BufLen-BufIdx, 0);
However if I run the above program either in debug/release mode, I get
iStatus value as '7' instead of 72007.
Note: int BufLen = 96000
Can someone please tell me why it is going wrong during run time?
2K)notable thing is, for any response whose size is small (say less than
response comes back fine from recv()
Maybe it's not going wrong, it could be that your expectation is wrong.
You should not expect to receive all of the data that's been sent in one
call to recv().
When debugging there is more time for the data to be sent and arrive in
your socket.
HTH
Dave.
.
- Follow-Ups:
- Re: partial receive in socket recv() issue for large response
- From: Arkady Frenkel
- Re: partial receive in socket recv() issue for large response
- References:
- Re: partial receive in socket recv() issue for large response
- From: Dave Lowther
- Re: partial receive in socket recv() issue for large response
- From: Arkady Frenkel
- Re: partial receive in socket recv() issue for large response
- Prev by Date: Re: help with sockets...
- Next by Date: Re: partial receive in socket recv() issue for large response
- Previous by thread: Re: partial receive in socket recv() issue for large response
- Next by thread: Re: partial receive in socket recv() issue for large response
- Index(es):
Relevant Pages
|