Receive All Packets ( Opposite of SendAll from Beej tutorials )



Hi

Is there a code snippet for receiving packets completely. I mean
during transactions there is a possibility that you won't send or
receive the packets completely. In Beej's tutorials, he has the
SendAll for ensuring that you send the packets.

int sendall(int const s, char const *const buf, int *const len)
{

int total = 0; /* how many bytes we've sent */
int bytesleft = *len; /* how many we have left to send */
int n;
while(total < *len) {
n = send(s, buf+total, bytesleft, 0);
if (n == -1) { break; }
total += n;
bytesleft -= n;
}
*len = total; /* return number actually sent here */
return n==-1?-1:0; /* return -1 on failure, 0 on success */
}


Is there a similar function for receiving all? The tutorial mention
some tips but its very vague for a beginner like me. A terminator
comma( ; ) signals that the transaction is complete. From my
understanding, I can also receive something like this 11;2 , a
packet from the next send can be also fetch if i use just the inverse
of sendall. Would anyone give a sample? I am googling it but can't
find the similar problem. I'm already in panic mode, I need the code
ASAP. The problem arises because I'm connecting to another program
made by others in another language. They don't check if they correctly
send all the packets (does not have something like sendall), I am the
one the must give in (because of seniority). Thanks in advance!

.



Relevant Pages

  • Re: isochronous receives?
    ... didn't print out info about receiving packets or interrupts. ... app claimed there were no packets received although the bus analyzer ...
    (Linux-Kernel)
  • RE: isochronous receives?
    ... didn't print out info about receiving packets or interrupts. ... I've noticed that if data is transmitted on channel 63, ... My currently my iso xmit stuff does appear to ...
    (Linux-Kernel)
  • Re: isochronous receives?
    ... didn't print out info about receiving packets or interrupts. ... I was setting the tag to -1 in a certain spot (which indicates ... Passing in '0' will completely bone you: ...
    (Linux-Kernel)
  • performance degradation after several inserts
    ... We have a VB6 app that uses an MSDE SP3 database. ... transactions to add data to the database. ... As several similar packets of data ... packets of data we get a 30 second upload time per packet, ...
    (microsoft.public.sqlserver.msde)
  • not receiving packets
    ... I am suddenly unable to receive any packets. ... computers on my Lan one is working fine sending and ... receiving packets, but the other is only sending packets. ... I have disconnected it from the Lan and connected it ...
    (microsoft.public.windowsxp.network_web)