C# + .NET: Minimalistic asynchronous UDP example

Recently I have been experimenting with networking in Unity3d.

As you may know, there are various systems to aid you with building networked applications in Unity, ranging in approaches and capabilities.

However, if you are more familiar with the regular socket APIs, or just need to port a bit of existing code, you would probably rather have a couple of simple methods to send and receive data.

So here's just that, using .NET's System.Net.Sockets.UdpClient to asynchronously receive and handle data as it arrives:

Continue reading