Last active
May 27, 2020 10:33
-
-
Save deeja/261ae5260b945efddddaaef270aa1b58 to your computer and use it in GitHub Desktop.
UdpClient for local data receive - Works on dotnet core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class Program | |
{ | |
private const int PORT = 4843; | |
private static void Main(string[] args) | |
{ | |
Console.WriteLine("Packet Forwarding UP!"); | |
var client = new UdpClient(PORT); | |
var ipEndPoint = new IPEndPoint(IPAddress.Loopback, PORT); | |
while (true) | |
{ | |
Console.Write("Waiting... "); | |
var receive = client.Receive(ref ipEndPoint); | |
Console.WriteLine(" - Received Data - " + receive.Length); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment