Ejemplo n.º 1
0
        void RegClient(object videoURI)
        {
            lock (this)
            {
                try
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.BootStrap || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.SuperNode || VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithNetP2P)
                    {
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcJoin       += new ClsNetP2PUserVideo.delsvcJoin(ctlUserVideo_EntsvcJoin);
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(ctlUserVideo_EntsvcSendStream);
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcUnJoin     += new ClsNetP2PUserVideo.delsvcUnJoin(ctlUserVideo_EntsvcUnJoin);

                        npcDirectXVideo           = new NetPeerClient();
                        netp2pDirectXVideoChannel = (INetP2PUserVideoChannel)npcDirectXVideo.OpenClient <INetP2PUserVideoChannel>(videoURI.ToString(), videoURI.ToString().Split(':')[2].Split('/')[2], ref objDirectXVideo);
                        netp2pDirectXVideoChannel.svcJoin(MyUserName);
                    }
                    else
                    {
                        int count = 0;
                        while (count < 90)
                        {
                            try
                            {
                                bhcDirectXVideo         = new BasicHttpClient();
                                httpDirectXVideoChannel = (IHttpUserVideo)bhcDirectXVideo.OpenClient <IHttpUserVideo>(videoURI.ToString());
                                httpDirectXVideoChannel.svcJoin(MyUserName);

                                count = 90;

                                if (MyVidType != "Me")
                                {
                                    disptGetImages.Start();
                                }
                            }
                            catch
                            {
                                System.Threading.Thread.Sleep(TimeSpan.FromSeconds(1));
                                count++;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegClient", "ctlUserVideo.xaml.cs");
                }
            }
        }
Ejemplo n.º 2
0
        public void RegNetP2pClient(object videoURI)
        {
            try
            {
                object objDirectXVideo = new ClsNetP2PUserVideo();
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcJoin       += new ClsNetP2PUserVideo.delsvcJoin(ctlUserVideo_EntsvcJoin);
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(ctlUserVideo_EntsvcSendStream);
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcUnJoin     += new ClsNetP2PUserVideo.delsvcUnJoin(ctlUserVideo_EntsvcUnJoin);

                NetPeerClient npcDirectXVideo = new NetPeerClient();
                netp2pDirectXVideoChannel = (INetP2PUserVideoChannel)npcDirectXVideo.OpenClient <INetP2PUserVideoChannel>(videoURI.ToString(), videoURI.ToString().Split(':')[2].Split('/')[2], ref objDirectXVideo);
                netp2pDirectXVideoChannel.svcJoin("");
            }

            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "clsVideoSNode.cs");
            }
        }
Ejemplo n.º 3
0
        public void RegNetP2pClient(object NetP2pUri)
        {
            try
            {
                NetPeerClient npcDummyClient = new NetPeerClient();
                objClsNetP2PUserVideo = new ClsNetP2PUserVideo();
                ((ClsNetP2PUserVideo)objClsNetP2PUserVideo).EntsvcJoin       += new ClsNetP2PUserVideo.delsvcJoin(UserVideoDummies_NetP2P_EntsvcJoin);
                ((ClsNetP2PUserVideo)objClsNetP2PUserVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(UserVideoDummies_NetP2P_EntsvcSendStream);
                ((ClsNetP2PUserVideo)objClsNetP2PUserVideo).EntsvcUnJoin     += new ClsNetP2PUserVideo.delsvcUnJoin(UserVideoDummies_NetP2P_EntsvcUnJoin);

                //((ClsNetP2PMainVideo)objClsNetP2PUserVideo).EntsvcJoin += new ClsNetP2PUserVideo.delsvcJoin(UserVideoDummies_NetP2P_EntsvcJoin);
                //((ClsNetP2PMainVideo)objClsNetP2PUserVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(UserVideoDummies_NetP2P_EntsvcSendStream);
                //((ClsNetP2PMainVideo)objClsNetP2PUserVideo).EntsvcUnJoin += new ClsNetP2PUserVideo.delsvcUnJoin(UserVideoDummies_NetP2P_EntsvcUnJoin);



                objINetP2PChannel = (INetP2PUserVideoChannel)npcDummyClient.OpenClient <INetP2PUserVideoChannel>(NetP2pUri.ToString(), NetP2pUri.ToString().Split(':')[2].Split('/')[2], ref objClsNetP2PUserVideo);

                while (tempcounter < 20)
                {
                    try
                    {
                        objINetP2PChannel.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }

            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "UserVideoDummies.cs");
            }
        }
Ejemplo n.º 4
0
        public void RegNetP2pClient(object videoURI)
        {
            try
            {
                object objDirectXVideo = new ClsNetP2PUserVideo();
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcJoin += new ClsNetP2PUserVideo.delsvcJoin(ctlUserVideo_EntsvcJoin);
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(ctlUserVideo_EntsvcSendStream);
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcUnJoin += new ClsNetP2PUserVideo.delsvcUnJoin(ctlUserVideo_EntsvcUnJoin);

                NetPeerClient npcDirectXVideo = new NetPeerClient();
                netp2pDirectXVideoChannel = (INetP2PUserVideoChannel)npcDirectXVideo.OpenClient<INetP2PUserVideoChannel>(videoURI.ToString(), videoURI.ToString().Split(':')[2].Split('/')[2], ref objDirectXVideo);
                netp2pDirectXVideoChannel.svcJoin("");
            }

            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "clsVideoSNode.cs");             
            }
        }
Ejemplo n.º 5
0
        void RegClient(object videoURI)
        {
            lock (this)
            {
                try
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.BootStrap || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.SuperNode || VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithNetP2P)
                    {
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcJoin += new ClsNetP2PUserVideo.delsvcJoin(ctlUserVideo_EntsvcJoin);
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(ctlUserVideo_EntsvcSendStream);
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcUnJoin += new ClsNetP2PUserVideo.delsvcUnJoin(ctlUserVideo_EntsvcUnJoin);

                        npcDirectXVideo = new NetPeerClient();
                        netp2pDirectXVideoChannel = (INetP2PUserVideoChannel)npcDirectXVideo.OpenClient<INetP2PUserVideoChannel>(videoURI.ToString(), videoURI.ToString().Split(':')[2].Split('/')[2], ref objDirectXVideo);
                        netp2pDirectXVideoChannel.svcJoin(MyUserName);
                    }
                    else
                    {
                        int count = 0;
                        while (count < 90)
                        {
                            try
                            {
                                bhcDirectXVideo = new BasicHttpClient();
                                httpDirectXVideoChannel = (IHttpUserVideo)bhcDirectXVideo.OpenClient<IHttpUserVideo>(videoURI.ToString());
                                httpDirectXVideoChannel.svcJoin(MyUserName);

                                count = 90;

                                if (MyVidType != "Me")
                                {
                                    disptGetImages.Start();
                                }
                            }
                            catch
                            {
                                System.Threading.Thread.Sleep(TimeSpan.FromSeconds(1));
                                count++;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegClient", "ctlUserVideo.xaml.cs");             
                }
            }
        }
Ejemplo n.º 6
0
        public void RegNetP2pClient(object NetP2pUri)
        {
            try
            {
                NetPeerClient npcDummyClient = new NetPeerClient();
                objClsNetP2PUserVideo = new ClsNetP2PUserVideo();
                ((ClsNetP2PUserVideo)objClsNetP2PUserVideo).EntsvcJoin += new ClsNetP2PUserVideo.delsvcJoin(UserVideoDummies_NetP2P_EntsvcJoin);
                ((ClsNetP2PUserVideo)objClsNetP2PUserVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(UserVideoDummies_NetP2P_EntsvcSendStream);
                ((ClsNetP2PUserVideo)objClsNetP2PUserVideo).EntsvcUnJoin += new ClsNetP2PUserVideo.delsvcUnJoin(UserVideoDummies_NetP2P_EntsvcUnJoin);

                //((ClsNetP2PMainVideo)objClsNetP2PUserVideo).EntsvcJoin += new ClsNetP2PUserVideo.delsvcJoin(UserVideoDummies_NetP2P_EntsvcJoin);
                //((ClsNetP2PMainVideo)objClsNetP2PUserVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(UserVideoDummies_NetP2P_EntsvcSendStream);
                //((ClsNetP2PMainVideo)objClsNetP2PUserVideo).EntsvcUnJoin += new ClsNetP2PUserVideo.delsvcUnJoin(UserVideoDummies_NetP2P_EntsvcUnJoin);

                

                objINetP2PChannel = (INetP2PUserVideoChannel)npcDummyClient.OpenClient<INetP2PUserVideoChannel>(NetP2pUri.ToString(), NetP2pUri.ToString().Split(':')[2].Split('/')[2], ref objClsNetP2PUserVideo);

                while (tempcounter < 20)
                {
                    try
                    {
                        objINetP2PChannel.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }

            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "UserVideoDummies.cs");             
            }
        }