コード例 #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
ファイル: ctlVideo.xaml.cs プロジェクト: xiaoliukai/VMukti
 void Current_Exit(object sender, ExitEventArgs e)
 {
     try
     {
         if (dispTimer != null)
         {
             dispTimer.Stop();
         }
         if (channelHttp != null)
         {
             channelHttp = null;
         }
         if (channelNetP2P != null && channelNetP2P.State == CommunicationState.Opened)
         {
             channelNetP2P.svcUnJoin(VMuktiInfo.CurrentPeer.DisplayName);
             channelNetP2P.Dispose();
             channelNetP2P = null;
         }
         cnvVideos.Children.Clear();
     }
     catch (Exception ex)
     {
         VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "Current_Exit", "ctlVideo.xaml.cs");
     }
 }
コード例 #3
0
        public void RegNetP2pClient(object NetP2pUri)
        {
            try
            {
                NetPeerClient npcDummyClient = new NetPeerClient();
                objClsNetP2PMainVideo = new ClsNetP2PMainVideo();
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcJoin        += new ClsNetP2PMainVideo.delsvcJoin(MainVideoDummies_NetP2P_EntsvcJoin);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcGetUserList += new ClsNetP2PMainVideo.delsvcGetUserList(MainVideoDummies_NetP2P_EntsvcGetUserList);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcSetUserList += new ClsNetP2PMainVideo.delsvcSetUserList(MainVideoDummies_NetP2P_EntsvcSetUserList);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcUnJoin      += new ClsNetP2PMainVideo.delsvcUnJoin(MainVideoDummies_NetP2P_EntsvcUnJoin);

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

                while (tempcounter < 20)
                {
                    try
                    {
                        objINetP2PChannel.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "--RegNetP2pClient()---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);
            }
        }
コード例 #4
0
ファイル: ctlVideo.xaml.cs プロジェクト: xiaoliukai/VMukti
        public void ClosePod()
        {
            //call unjoin method
            try
            {
                if (_MyMeetingRole == MeetingRoles.Host)
                {
                    if (channelNetP2P != null)
                    {
                        channelNetP2P.svcClose(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                    }
                }

                foreach (ctlUserVideo ctl1 in cnvVideos.Children)
                {
                    ctl1.ClosePod();
                }
                if (dispTimer != null)
                {
                    dispTimer.Stop();
                }
                if (channelHttp != null)
                {
                    channelHttp = null;
                }
                if (channelNetP2P != null && channelNetP2P.State == CommunicationState.Opened)
                {
                    channelNetP2P.svcUnJoin(VMuktiInfo.CurrentPeer.DisplayName);
                }

                if (channelNetP2P != null)
                {
                    channelNetP2P.Close();
                    channelNetP2P.Dispose();
                    channelNetP2P = null;
                }

                cnvVideos.Children.Clear();
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ClosePod", "ctlVideo.xaml.cs");
            }
        }
コード例 #5
0
ファイル: P2PVideoClient.cs プロジェクト: xiaoliukai/VMukti
        void RegVideop2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyVideo = new NetPeerClient();
                objNetTcpVideo = new ClsNetP2PMainVideo();
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcJoin        += new ClsNetP2PMainVideo.delsvcJoin(P2PVideoClient_EntsvcJoin);
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcGetUserList += new ClsNetP2PMainVideo.delsvcGetUserList(P2PVideoClient_EntsvcGetUserList);
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcSetUserList += new ClsNetP2PMainVideo.delsvcSetUserList(P2PVideoClient_EntsvcSetUserList);
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcUnJoin      += new ClsNetP2PMainVideo.delsvcUnJoin(P2PVideoClient_EntsvcUnJoin);
                channelNettcpVideo = (INetP2PMainVideoChannel)npcDummyVideo.OpenClient <INetP2PMainVideoChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpVideo);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpVideo.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                exp.Data.Add("My Key", "RegVideop2pClient()--:--P2PVideoClient.cs--:--" + exp.Message + " :--:--");
                //ClsException.LogError(exp);
                //ClsException.WriteToErrorLogFile(exp);
                System.Text.StringBuilder sb = new StringBuilder();
                sb.AppendLine(exp.Message);
                sb.AppendLine();
                sb.AppendLine("StackTrace : " + exp.StackTrace);
                sb.AppendLine();
                sb.AppendLine("Location : " + exp.Data["My Key"].ToString());
                sb.AppendLine();
                sb1 = CreateTressInfo();
                sb.Append(sb1.ToString());
                VMuktiAPI.ClsLogging.WriteToTresslog(sb);
            }
        }
コード例 #6
0
ファイル: ctlVideo.xaml.cs プロジェクト: xiaoliukai/VMukti
 public void Dispose()
 {
     //MessageBox.Show("Dispose of chat called");
     try
     {
         if (channelNetP2P != null)
         {
             channelNetP2P.Close();
             channelNetP2P.Dispose();
             channelNetP2P = null;
         }
         if (channelHttp != null)
         {
             channelHttp = null;
         }
         GC.Collect();
         GC.WaitForPendingFinalizers();
         //GC.SuppressFinalize(this);
     }
     catch (Exception exp)
     {
         VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "Dispose", "ctlVideo.xaml.cs");
     }
 }
コード例 #7
0
        public void RegNetP2pClient(object NetP2pUri)
        {
            try
            {
                NetPeerClient npcDummyClient = new NetPeerClient();
                objClsNetP2PMainVideo = new ClsNetP2PMainVideo();
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcJoin += new ClsNetP2PMainVideo.delsvcJoin(MainVideoDummies_NetP2P_EntsvcJoin);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcGetUserList += new ClsNetP2PMainVideo.delsvcGetUserList(MainVideoDummies_NetP2P_EntsvcGetUserList);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcSetUserList += new ClsNetP2PMainVideo.delsvcSetUserList(MainVideoDummies_NetP2P_EntsvcSetUserList);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcUnJoin += new ClsNetP2PMainVideo.delsvcUnJoin(MainVideoDummies_NetP2P_EntsvcUnJoin);

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

                while (tempcounter < 20)
                {
                    try
                    {
                        objINetP2PChannel.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "--RegNetP2pClient()---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);
            }
        }
コード例 #8
0
        public void Dispose()
        {
            //MessageBox.Show("Dispose of chat called");
			try
			{		
                
				if (channelNetP2P != null)
				{
                    channelNetP2P.Close();
                    channelNetP2P.Dispose();
                    channelNetP2P = null;
				}
				if (channelHttp != null)
				{
					channelHttp = null;
				}
                GC.Collect();
                GC.WaitForPendingFinalizers();
                //GC.SuppressFinalize(this);
			}
			catch (Exception exp)
			{
                VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "Dispose", "ctlVideo.xaml.cs");             
			}
        }
コード例 #9
0
        public void ClosePod()
        {
            //call unjoin method
            try
            {

                if (_MyMeetingRole == MeetingRoles.Host)
                {
                    if (channelNetP2P != null)
                    {
                        channelNetP2P.svcClose(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                    }
                }

                foreach (ctlUserVideo ctl1 in cnvVideos.Children)
                {
                    ctl1.ClosePod();
                }
                if (dispTimer != null)
                {
                    dispTimer.Stop();
                }
                if (channelHttp != null)
                {
                    channelHttp = null;
                }
                if (channelNetP2P != null && channelNetP2P.State == CommunicationState.Opened)
                {
                    channelNetP2P.svcUnJoin(VMuktiInfo.CurrentPeer.DisplayName);
                }

                if (channelNetP2P != null)
                {
                    channelNetP2P.Close();
                    channelNetP2P.Dispose();
                    channelNetP2P = null;
                }

                cnvVideos.Children.Clear();
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ClosePod", "ctlVideo.xaml.cs");
            }
        }
コード例 #10
0
 void Current_Exit(object sender, ExitEventArgs e)
 {
     try
     {
         if (dispTimer != null)
         {
             dispTimer.Stop();
         }
         if (channelHttp != null)
         {
             channelHttp = null;
         }
         if (channelNetP2P != null && channelNetP2P.State == CommunicationState.Opened)
         {
             channelNetP2P.svcUnJoin(VMuktiInfo.CurrentPeer.DisplayName);
             channelNetP2P.Dispose();
             channelNetP2P = null;
         }
         cnvVideos.Children.Clear();
     }
     catch (Exception ex)
     {
         VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "Current_Exit", "ctlVideo.xaml.cs");             
     }
 }
コード例 #11
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");             
                
            }

        }
コード例 #12
0
        void RegVideop2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyVideo = new NetPeerClient();
                objNetTcpVideo = new ClsNetP2PMainVideo();
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcJoin +=new ClsNetP2PMainVideo.delsvcJoin(P2PVideoClient_EntsvcJoin);
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcGetUserList += new ClsNetP2PMainVideo.delsvcGetUserList(P2PVideoClient_EntsvcGetUserList);
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcSetUserList += new ClsNetP2PMainVideo.delsvcSetUserList(P2PVideoClient_EntsvcSetUserList);
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcUnJoin += new ClsNetP2PMainVideo.delsvcUnJoin(P2PVideoClient_EntsvcUnJoin);
                channelNettcpVideo = (INetP2PMainVideoChannel)npcDummyVideo.OpenClient<INetP2PMainVideoChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpVideo);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpVideo.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                exp.Data.Add("My Key", "RegVideop2pClient()--:--P2PVideoClient.cs--:--" + exp.Message + " :--:--");
                //ClsException.LogError(exp);
                //ClsException.WriteToErrorLogFile(exp);
                System.Text.StringBuilder sb = new StringBuilder();
                sb.AppendLine(exp.Message);
                sb.AppendLine();
                sb.AppendLine("StackTrace : " + exp.StackTrace);
                sb.AppendLine();
                sb.AppendLine("Location : " + exp.Data["My Key"].ToString());
                sb.AppendLine();
                sb1 = CreateTressInfo();
                sb.Append(sb1.ToString());
                VMuktiAPI.ClsLogging.WriteToTresslog(sb);
            }
        }