コード例 #1
0
        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();
                }
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: rasberry/AutoCar
        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(); }
            }
        }