huangyuan01 / aforge

Automatically exported from code.google.com/p/aforge
Other
0 stars 0 forks source link

Creating VideoSourcePlayer in WCF-service causes timeout errors on access service methods #322

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
There is console application (host for WCF-service):

        static VideoSourcePlayer player;

        static void Main(string[] args)
        {
            var s = new WSSample();
            using (var host = new ServiceHost(s,
                new Uri("net.pipe://localhost/SampleService")))
            {
                //important: create instance here causes error on access
                player = new VideoSourcePlayer();
                host.AddServiceEndpoint(typeof(IWSSample),
                    new NetNamedPipeBinding(), "");

                host.Open();
//if create instance after host.Open(), there are no problems on service invokes
//player = new VideoSourcePlayer();
                Console.WriteLine("Service is available. " +
                  "Press <ENTER> to exit.");
                Console.ReadLine();

                host.Close();
            }
        }

What is a problem, if I create VideoSourcePlayer instance before host.Open(), 
it will be timeout errors on service methods invoke attempts? But if remove 
first line with player creation, and uncomment second - there are no problem on 
service access.

Original issue reported on code.google.com by Mikol...@gmail.com on 14 Nov 2012 at 4:53

GoogleCodeExporter commented 8 years ago

Original comment by andrew.k...@gmail.com on 14 Nov 2012 at 9:08