© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•6mo ago•
4 replies
Ilonic

Getting constant address instead of ephemeral one

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?
Pastebin
Agent.cs UdpClient client = new UdpClient(9); // UdpClie...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

interface instead of mapping one by one
C#CC# / help
4y ago
.NET 7 Rate Limit by IP address instead of Path
C#CC# / help
4y ago
✅ System.Net.Sockets.SocketException (10048): Only one usage of each socket address
C#CC# / help
12mo ago