コード例 #1
0
ファイル: ctlVideo.xaml.cs プロジェクト: xiaoliukai/VMukti
        void hostMainVideoService(object lstParams)
        {
            try
            {
                List <object> lstTempObj = (List <object>)lstParams;
                strUri = lstTempObj[1].ToString();

                if ((VMuktiAPI.PeerType)lstTempObj[0] == PeerType.BootStrap || (VMuktiAPI.PeerType)lstTempObj[0] == PeerType.SuperNode || (VMuktiAPI.PeerType)lstTempObj[0] == PeerType.NodeWithNetP2P)
                {
                    NetPeerClient npcNetP2P = new NetPeerClient();
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcJoin        += new ClsNetP2PMainVideo.delsvcJoin(ctlVideo_EntsvcJoin);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcGetUserList += new ClsNetP2PMainVideo.delsvcGetUserList(ctlVideo_EntsvcGetUserList);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcSetUserList += new ClsNetP2PMainVideo.delsvcSetUserList(ctlVideo_EntsvcSetUserList);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcClose       += new ClsNetP2PMainVideo.delsvcClose(ctlVideo_EntsvcClose);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcUnJoin      += new ClsNetP2PMainVideo.delsvcUnJoin(ctlVideo_EntsvcUnJoin);
                    channelNetP2P = (INetP2PMainVideoChannel)npcNetP2P.OpenClient <INetP2PMainVideoChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetP2PMainVideo);

                    while (tempcounter < 20)
                    {
                        try
                        {
                            channelNetP2P.svcJoin(VMuktiInfo.CurrentPeer.DisplayName);
                            tempcounter = 20;
                            channelNetP2P.svcGetUserList(VMuktiInfo.CurrentPeer.DisplayName, strLocalCameraUri);
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                }
                else
                {
                    //BasicHttpClient httpClient = new BasicHttpClient();
                    //channelHttp = (IHttpMainVideo)httpClient.OpenClient<IHttpMainVideo>(strUri);

                    //while (tempcounter < 20)
                    //{
                    //    try
                    //    {
                    //        channelHttp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                    //        tempcounter = 20;
                    //    }
                    //    catch
                    //    {
                    //        tempcounter++;
                    //        System.Threading.Thread.Sleep(1000);
                    //    }
                    //}
                    //dispTimer.Interval = TimeSpan.FromSeconds(5);
                    //dispTimer.Tick += new EventHandler(dispTimer_Tick);
                    //dispTimer.Start();
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "hostMainVideoService", "ctlVideo.xaml.cs");
            }
        }
コード例 #2
0
 void MainVideoDummies_http_EntsvcGetUserList(string UName, string videoURI)
 {
     try
     {
         objINetP2PChannel.svcGetUserList(UName, videoURI);
     }
     catch (Exception ex)
     {
         ex.Data.Add("My Key", "--MainVideoDummies_http_EntsvcGetUserList()---VMukti--:--VmuktiModules--:--Collaborative--:--Video.Presentation--:--MainVideoDummies.cs--:");
         //ClsException.LogError(ex);
         //ClsException.WriteToErrorLogFile(ex);
         System.Text.StringBuilder sb = new StringBuilder();
         sb.AppendLine(ex.Message);
         sb.AppendLine();
         sb.AppendLine("StackTrace : " + ex.StackTrace);
         sb.AppendLine();
         sb.AppendLine("Location : " + ex.Data["My Key"].ToString());
         sb.AppendLine();
         sb1 = CreateTressInfo();
         sb.Append(sb1.ToString());
         VMuktiAPI.ClsLogging.WriteToTresslog(sb);
     }
 }
コード例 #3
0
        void hostMainVideoService(object lstParams)
        {
            try
            {
                List<object> lstTempObj = (List<object>)lstParams;
                strUri = lstTempObj[1].ToString();

                if ((VMuktiAPI.PeerType)lstTempObj[0] == PeerType.BootStrap || (VMuktiAPI.PeerType)lstTempObj[0] == PeerType.SuperNode || (VMuktiAPI.PeerType)lstTempObj[0] == PeerType.NodeWithNetP2P)
                {
                    NetPeerClient npcNetP2P = new NetPeerClient();
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcJoin += new ClsNetP2PMainVideo.delsvcJoin(ctlVideo_EntsvcJoin);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcGetUserList += new ClsNetP2PMainVideo.delsvcGetUserList(ctlVideo_EntsvcGetUserList);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcSetUserList += new ClsNetP2PMainVideo.delsvcSetUserList(ctlVideo_EntsvcSetUserList);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcClose += new ClsNetP2PMainVideo.delsvcClose(ctlVideo_EntsvcClose);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcUnJoin += new ClsNetP2PMainVideo.delsvcUnJoin(ctlVideo_EntsvcUnJoin);
                    channelNetP2P = (INetP2PMainVideoChannel)npcNetP2P.OpenClient<INetP2PMainVideoChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetP2PMainVideo);

                    while (tempcounter < 20)
                    {
                        try
                        {
                            channelNetP2P.svcJoin(VMuktiInfo.CurrentPeer.DisplayName);
                            tempcounter = 20;
                            channelNetP2P.svcGetUserList(VMuktiInfo.CurrentPeer.DisplayName, strLocalCameraUri);
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                }
                else
                {
                    //BasicHttpClient httpClient = new BasicHttpClient();
                    //channelHttp = (IHttpMainVideo)httpClient.OpenClient<IHttpMainVideo>(strUri);

                    //while (tempcounter < 20)
                    //{
                    //    try
                    //    {
                    //        channelHttp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                    //        tempcounter = 20;
                    //    }
                    //    catch
                    //    {
                    //        tempcounter++;
                    //        System.Threading.Thread.Sleep(1000);
                    //    }
                    //}
                    //dispTimer.Interval = TimeSpan.FromSeconds(5);
                    //dispTimer.Tick += new EventHandler(dispTimer_Tick);
                    //dispTimer.Start();
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "hostMainVideoService", "ctlVideo.xaml.cs");             
                
            }

        }