DHCP Query, can make request but not recieve data

  • Thread starter Thread starter Wayne M J
  • Start date Start date
W

Wayne M J

byte[] send = new byte[237];
byte[] recv = new byte[237];
send[0] = 1;
send[1] = 1;
send[2] = 6;
IPAddress ip = IPAddress.Parse("255.255.255.255");
IPEndPoint iep = new IPEndPoint(ip, 67);
IPEndPoint iep2 = new IPEndPoint(IPAddress.Parse(ip, 68);
UdpClient udp = new UdpClient();
udp.Send(send, send.Length, iep);
recv = udp.Receive(ref iep2); // Does not receive anything.
Console.WriteLine(recv.Length);

The above works. It discovers the DHCP server, and is even assigned an IP
Address (per the DHCP MMC on the server), but when I listen on the client
port, nothing happens at all.

Any ideas?
 
Back
Top