// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Net; using System.Net.Sockets; namespace E { public class Server { public static void Main(string[] args) { UdpClient srv = new UdpClient(12345); IPEndPoint snd = new IPEndPoint(IPAddress.Any, 0); byte[] b = srv.Receive(ref snd); Console.WriteLine("Received {0} bytes from {1} port {2}", b.Length, snd.Address.ToString(), snd.Port); srv.Close(); } } }