It's been a while and I don't have my copy of Stevens handy, but I'm fairly sure that reads on a UDP socket preserve packet boundaries. You've got to read an entire packet at once, otherwise there'd be no way to determine where the contents of one message ended and the next began (remember UDP is an unordered datagram protocol, not a stream). Read the entire packet into a buffer then pass that buffer around and extract what you're interested from it as you need it.
In reply to Re: Reading UDP with sysread
by Fletch
in thread Reading UDP with sysread
by xfbuck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |