Ejemplo n.º 1
0
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyImageSharing = new NetPeerClient();
                objNetTcpImageSharing = new clsNetTcpImageSharing();

                ((clsNetTcpImageSharing)objNetTcpImageSharing).EntsvcJoin += new clsNetTcpImageSharing.delsvcJoin(ImageSharingDummy_EntsvcJoin);
                ((clsNetTcpImageSharing)objNetTcpImageSharing).EntsvcSendIamge += new clsNetTcpImageSharing.delsvcSendIamge(ImageSharingDummy_EntsvcSendIamge);
                ((clsNetTcpImageSharing)objNetTcpImageSharing).EntsvcUnJoin += new clsNetTcpImageSharing.delsvcUnJoin(ImageSharingDummy_EntsvcUnJoin);

                channelNettcpImageSharing = (INetTcpImageShareChannel)npcDummyImageSharing.OpenClient<INetTcpImageShareChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpImageSharing);

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

            }
        }
        void GlobalVariable()
        {
            try
            {
                objNetTcpImageShare = new clsNetTcpImageSharing();
                lstImage = new List<byte[]>();
                lstImgBlock = new List<byte[]>();
                blFirstImg = false;

                objSetImage = new DelSetImage(delSetImage);
                objImageBlock = new DelImageBlock(delImageBlock);
                objDelGetMsg = new DelGetMessage(delGetMessage);
                objDelAddImage = new DelAddIamge(delAddImage);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GlobalVariable", "ctlImageSharing.xaml.cs");
            }

        }