static void Main(string[] args) { MyNetwork net = new MyNetwork(); try { net.GetDateFromClients(); } catch (Exception e) { } finally { net.Close(); } Console.ReadKey(); }