Skip to contentSkip to conversation

Efficient UDP Programming

DISCUSSION Chuck Winters 2 participants 2 messages Aug 21, 2004 – Aug 23, 2004

lore
Share & tools
lore
#0 lore raw

Is there anyway of reading some data from a UDP socket without removing it from the received queue? What I need to do is read in the header from a packet to determine how large of a memory chunk I need to allocate.

Thanks,
Chuck

#1 lore raw

I suggest you to have a fixed size for your header, then you can read the header that ll say you about the rest of data following the header.

Luciano

Chuck Winters escreveu:

Quoted 16 lines

Is there anyway of reading some data from a UDP socket without removing it from the received queue? What I need to do is read in the header from a packet to determine how large of a memory chunk I need to allocate.

Thanks,
Chuck

-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html