use the System.Net.Sockets namespace and the TcpClient and TcpListener classes.