Пример #1
0
        void RegCoAuthp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyCoAuth = new NetPeerClient();
                objNetTcpCoAuth = new NetP2PCoAuthService();

                ((NetP2PCoAuthService)objNetTcpCoAuth).EntSvcJoin += new NetP2PCoAuthService.DelSvcJoin(P2PCoAuthClient_EntSvcJoin);
                ((NetP2PCoAuthService)objNetTcpCoAuth).EntsvcUnJoin += new NetP2PCoAuthService.DelsvcUnJoin(P2PCoAuthClient_EntsvcUnJoin);
                channelNettcpCoAuth = (INetP2PICoAuthServiceChannel)npcDummyCoAuth.OpenClient<INetP2PICoAuthServiceChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpCoAuth);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpCoAuth.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                VMuktiHelper.ExceptionHandler(exp, "RegCoAuthp2pClient", "P2PCoAuthClient.cs");
            }
        }
Пример #2
0
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyChat = new NetPeerClient();
                objNetP2PCoAuthService = new NetP2PCoAuthService();

                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntSvcJoin += new NetP2PCoAuthService.DelSvcJoin(NetP2PCoAuthService_EntSvcJoin);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSaveDoc += new NetP2PCoAuthService.DelsvcSaveDoc(NetP2PCoAuthService_EntsvcSaveDoc);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSetCompBytes += new NetP2PCoAuthService.DelsvcSetCompBytes(NetP2PCoAuthService_EntsvcSetCompBytes);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSetLength += new NetP2PCoAuthService.DelsvcSetLength(NetP2PCoAuthService_EntsvcSetLength);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcUnJoin += new NetP2PCoAuthService.DelsvcUnJoin(NetP2PCoAuthService_EntsvcUnJoin);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcReplySetLength += new NetP2PCoAuthService.DelsvcReplySetLength(NetP2PCoAuthService_EntsvcReplySetLength);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcGetUserList += new NetP2PCoAuthService.DelsvcGetUserList(NetP2PCoAuthService_EntsvcGetUserList);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSetUserList += new NetP2PCoAuthService.DelsvcSetUserList(NetP2PCoAuthService_EntsvcSetUserList);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSignOutCoAuth += new NetP2PCoAuthService.delsvcSignOutCoAuth(NetP2PCoAuthService_EntsvcSignOutCoAuth);

                channelNettcpCoAuth = (INetP2PICoAuthServiceChannel)npcDummyChat.OpenClient<INetP2PICoAuthServiceChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetP2PCoAuthService);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpCoAuth.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                VMuktiHelper.ExceptionHandler(exp, "RegNetP2PClient", "CoAuthDummy.cs");

            }
        }