Use the System.Net.Sockets class.