예제 #1
0
        public void hostActiveAgentService(object lstparam)
        {
            try
            {
                List <object> lstTempObj = (List <object>)lstparam;
                strUri = lstTempObj[0].ToString();

                NetPeerClient npcActiveAgent = new NetPeerClient();
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcJoin           += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcJoin(ctlrptActiveAgent_EntsvcJoin);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcGetAgentInfo   += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcGetAgentInfo(ctlrptActiveAgent_EntsvcGetAgentInfo);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcSetAgentInfo   += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcSetAgentInfo(ctlrptActiveAgent_EntsvcSetAgentInfo);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcSetAgentStatus += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcSetAgentStatus(ctlrptActiveAgent_EntsvcSetAgentStatus);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcBargeRequest   += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcBargeRequest(ctlrptActiveAgent_EntsvcBargeRequest);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcBargeReply     += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcBargeReply(ctlrptActiveAgent_EntsvcBargeReply);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcHangUp         += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcHangUp(ctlrptActiveAgent_EntsvcHangUp);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcUnJoin         += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcUnJoin(ctlrptActiveAgent_EntsvcUnJoin);

                channelNetTcp = (INetP2PBootStrapActiveAgentReportChannel)npcActiveAgent.OpenClient <INetP2PBootStrapActiveAgentReportChannel>(strUri, lstTempObj[1].ToString(), ref objNetTcpActiveAgent);
                channelNetTcp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, VMuktiAPI.VMuktiInfo.CurrentPeer.CampaignID.ToString());

                channelNetTcp.svcGetAgentInfo(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "hostActiveAgentService()", "ctlrptActiveAgent.xaml.cs");
                if (ex.InnerException != null && ex.InnerException.Message != "")
                {
                    VMuktiAPI.VMuktiHelper.ExceptionHandler(ex.InnerException, "hostActiveAgentService()--Inner", "ctlrptActiveAgent.xaml.cs");
                }
            }
        }
예제 #2
0
 void ctlrptActiveAgent_EntsvcJoin(string uName, string campaignId)
 {
     try
     {
         if (VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName != uName)
         {
             channelNetTcp.svcGetAgentInfo(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
         }
     }
     catch (Exception ex)
     {
         VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ctlrptActiveAgent_EntsvcJoin()", "ctlrptActiveAgent.xaml.cs");
     }
 }
        public void hostActiveAgentService(object lstparam)
        {
            try
            {
                List<object> lstTempObj = (List<object>)lstparam;
                strUri = lstTempObj[0].ToString();

                NetPeerClient npcActiveAgent = new NetPeerClient();
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcJoin += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcJoin(ctlrptActiveAgent_EntsvcJoin);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcGetAgentInfo += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcGetAgentInfo(ctlrptActiveAgent_EntsvcGetAgentInfo);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcSetAgentInfo += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcSetAgentInfo(ctlrptActiveAgent_EntsvcSetAgentInfo);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcSetAgentStatus += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcSetAgentStatus(ctlrptActiveAgent_EntsvcSetAgentStatus);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcBargeRequest += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcBargeRequest(ctlrptActiveAgent_EntsvcBargeRequest);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcBargeReply += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcBargeReply(ctlrptActiveAgent_EntsvcBargeReply);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcHangUp += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcHangUp(ctlrptActiveAgent_EntsvcHangUp);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcUnJoin += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcUnJoin(ctlrptActiveAgent_EntsvcUnJoin);

                channelNetTcp = (INetP2PBootStrapActiveAgentReportChannel)npcActiveAgent.OpenClient<INetP2PBootStrapActiveAgentReportChannel>(strUri, lstTempObj[1].ToString(), ref objNetTcpActiveAgent);
                channelNetTcp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, VMuktiAPI.VMuktiInfo.CurrentPeer.CampaignID.ToString());
                
                channelNetTcp.svcGetAgentInfo(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "hostActiveAgentService()", "ctlrptActiveAgent.xaml.cs");
                if (ex.InnerException != null && ex.InnerException.Message!="")
                {
                    VMuktiAPI.VMuktiHelper.ExceptionHandler(ex.InnerException, "hostActiveAgentService()--Inner", "ctlrptActiveAgent.xaml.cs");
                }
            }
        }