Re: Receive no data
Tech-Archive recommends: Speed Up your PC by fixing your registry
- From: "Günter Prossliner" <g.prossliner/gmx/at>
- Date: Thu, 6 Dec 2007 13:07:32 +0100
Hello!
After sending GET request, I check the return value of function recv
and
find the value is 0.
recv(socket, buffer, 100, 0) doesn't meen "wait until 100 bytes are
available and then return them to me". It meens "give me what you already
have within you input-buffer, but not more than 100 bytes".
So you have to check the Return-Value of "recv" (currently you only check
for error). If recvbytes < remainingbytes you have to re-issue the recv to
get the remaining bytes.
But when I debug the program step-by-step, I find that the return
value of function recv is non-zero and downloading is completed.
By going step-by-step the program runs very very slow, so the Network-Stack
is able to retrieve everything into the buffer.
OK?
GP
.
Relevant Pages
- Re: BSD sockets: recv with MSG_WAITALL should return EWOULDBLOCK?
... (I am not convinced it is much use for blocking sockets ... many bytes as the size argument to recv() or to close the connection ... And this sounds like 'if you are using a buffer size that doesn't ... Another frame arrives and more data is queued to the socket buffer. ... (comp.unix.programmer) - Re: TdiBuildReceive question
... Irp->IoStatus.Information < the size of the buffer. ... then it is better to fill it as much as possible, and not complete the recv() ... To prevent such a time loss, the TCP protocol has a PSH bit ... PSH means - "the sender does not know when the next bytes will ... (microsoft.public.development.device.drivers) - Re: recv WSAENOBUFS error
... cross-posting, I did cross-post it initially, but I just started using ... it always asks for the "packet length" amount in the call to recv. ... You can set kernel-mode buffer with setsockopt but you'll quickly finish ... (microsoft.public.win32.programmer.kernel) - Re: recv WSAENOBUFS error
... it always asks for the "packet length" amount in the call to recv. ... You can set kernel-mode buffer with setsockopt but you'll quickly finish ... your non-page (kernel) memory if you'll start to do it. ... (microsoft.public.win32.programmer.networks) - Re: recv WSAENOBUFS error
... it always asks for the "packet length" amount in the call to recv. ... You can set kernel-mode buffer with setsockopt but you'll quickly finish ... your non-page (kernel) memory if you'll start to do it. ... (microsoft.public.win32.programmer.kernel) |
|