static void Main(string[] args) { Console.WriteLine("Press enter when the server is running."); Console.ReadKey(); Listener listener = new Listener(); listener.Open(); Sender sender = new Sender(); sender.Go(); //sender.Dispose(); //listener.Dispose(); Console.WriteLine("Done, press enter to exit"); Console.ReadKey(); }