Esempio n. 1
0
        static void RunServer()
        {
            MyServer server = new MyServer();

#if false
            // Test code: Verify that objects do not go out of scope too soon
            GC.Collect();
            GC.WaitForPendingFinalizers();
#endif

            if (server.Initialize())
            {
#if false
                // Test code: Verify that objects do not go out of scope too soon
                GC.Collect();
                GC.WaitForPendingFinalizers();
#endif

                Console.WriteLine("Press ENTER key to stop server");
                Console.ReadLine();
                Console.WriteLine("...Key press detected.  Stopping..");
            }

#if false
            // Test code: Verify that objects do not go out of scope too soon
            GC.Collect();
            GC.WaitForPendingFinalizers();
#endif

            server.Dispose(); // Shutdown the Tonk object

#if false
            // Test code: Verify that objects do not go out of scope too soon
            GC.Collect();
            GC.WaitForPendingFinalizers();
#endif
        }
Esempio n. 2
0
 public MyServerConnection(MyServer server)
 {
     Server = server;
 }