Exemple #1
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");
            }
        }
Exemple #2
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);
            }
        }
Exemple #3
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);
            }
        }
        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);
            }
        }
        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");             
                
            }

        }
        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);
            }
        }