TheWhite 49 Junior Poster

I know how to create a UDP socket and bind it to an ip/port and how to read a stream of data from the socket using recvfrom(), but how can I get the data of a single UDP packet at a time?

For example if "data of one packet" was sent, then "data of another packet", I don't want to read in "data of one packet data of another packet" into my buffer, but to have only the data per packet sent and processed at any one recv.

Any suggestions?