lee.j.baxter -2 Junior Poster in Training

Hi folks,

I'm working on a PXE server application as part of a toolchain that I'm going to use to develop an OS. At the moment, I'm concentrating on the DHCP part, then I'll look at the TFTP part later on. Now, I'm aware that a DHCP uses UDP to communicate with a client, and UDP sends data in a rather 'ad-hoc' manner, making its reliability minimal.

Now, I want to develop a class in C# that can construct/decipher DHCP packets and send/receive these packets, using the Socket class to do all the communication. Now being as UDP is an unreliable protocol, I'm now wondering; do I need to send a packet and immediately listen for the response (so literally use Socket.SendTo(...) followed by Socket.ReceiveFrom(...) ), or do I need to start listening for the response BEFORE I send a packet so that I ensure that I catch the response?

Thanks, Lee.