So, I am developing a simple WakeOnLan program to turn the computer on and off ( using an agent ). And the thing works, but the problem is when trying to get an answer.
Code: https://pastebin.com/WiupUPQZ But when the agent receives any packet, I get an IP with an ephemeral port and when trying to answer I get an exception, however I have port forwarding for these computers in the router. How do I get the constant port in the IPEndPoint?