reading partially from sockets

Posted by nomad.alien on Stack Overflow See other posts from Stack Overflow or by nomad.alien
Published on 2010-06-18T11:30:13Z Indexed on 2010/06/18 11:33 UTC
Read the original article Hit count: 183

Filed under:
|
|

I'm having a little test program that sends a lot of udp packets between client->server->client (ping/pong test). The packets are fixed size on each run(last run is max allowable size of udp packet) I'm filling the packets with random data except for the beginning of each packet that contains the packet number. So I'm only interested to see if I receive all the packets back at the client.

I'm using sendto() and recvfrom() and I only read the sizeof(packet_number) (which in this case is an int). What happens to the rest of the data? Does it end up in fairyland (gets discarded)? or does the new packet that arrives gets appended to this "old" data?

(using linux)

© Stack Overflow or respective owner

Related posts about sockets

Related posts about udp