static void Main(string[] args) { SimpleServer server = null; VideoGrabber hand = null; try { hand = new VideoGrabber(Config.DeviceOne, Config.DeviceTwo); Thread vidworker = new Thread(new ThreadStart(hand.Start)); vidworker.Start(); server = new SimpleServer(Config.Port); server.ImgSource = hand; Thread webworker = new Thread(new ThreadStart(server.listen)); webworker.Start(); WL("Server started on port " + Config.Port + ". Press any key to shutdown"); ConsoleKeyInfo key = Console.ReadKey(true); } finally { if (server != null) { server.stop(); } if (hand != null) { hand.Stop(); } } }
static void Main(string[] args) { SimpleServer server = null; VideoGrabber hand = null; try { hand = new VideoGrabber(Config.DeviceOne,Config.DeviceTwo); Thread vidworker = new Thread(new ThreadStart(hand.Start)); vidworker.Start(); server = new SimpleServer(Config.Port); server.ImgSource = hand; Thread webworker = new Thread(new ThreadStart(server.listen)); webworker.Start(); WL("Server started on port "+Config.Port+". Press any key to shutdown"); ConsoleKeyInfo key = Console.ReadKey(true); } finally { if (server != null) { server.stop(); } if (hand != null) { hand.Stop(); } } }