Пример #1
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");             
            }
        }
Пример #2
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");             
            }
        }