void RegChatp2pClient(string P2PUri) { try { NetPeerClient npcDummyChat = new NetPeerClient(); objNetTcpChat = new clsNetTcpChat(); ((clsNetTcpChat)objNetTcpChat).EntsvcJoin += new clsNetTcpChat.delsvcJoin(DummyClient_EntsvcJoin); //((clsNetTcpChat)objNetTcpChat).EntsvcSendMessage += new clsNetTcpChat.delsvcSendMessage(DummyClient_EntsvcSendMessage); //((clsNetTcpChat)objNetTcpChat).EntsvcGetUserList += new clsNetTcpChat.delsvcGetUserList(DummyClient_EntsvcGetUserList); //((clsNetTcpChat)objNetTcpChat).EntsvcSetUserList += new clsNetTcpChat.delsvcSetUserList(DummyClient_EntsvcSetUserList); //((clsNetTcpChat)objNetTcpChat).EntsvcSignOutChat += new clsNetTcpChat.delsvcSignOutChat(DummyClient_EntsvcSignOutChat); ((clsNetTcpChat)objNetTcpChat).EntsvcUnJoin += new clsNetTcpChat.delsvcUnJoin(DummyClient_EntsvcUnJoin); channelNettcpChat = (INetTcpChatChannel)npcDummyChat.OpenClient<INetTcpChatChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpChat); while (tempcounter < 20) { try { channelNettcpChat.svcJoin(UserName); tempcounter = 20; } catch { tempcounter++; System.Threading.Thread.Sleep(1000); } } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "P2PChatp2pClient", "P2PChatClient.cs"); } }
void GlobalVariable() { try { objNetTcpChat = new clsNetTcpChat(); objHttpChat = new clsHttpChat(); temp = 0; tempcounter = 0; blnTypingStatus = false; blnSendTypeMsg = true; //arr = new byte[5000]; lstName = new List<string>(); lstTypingUsers = new List<string>(); isChatHistoryFolderCreated = false; isChatHistoryEnabled = true; objDelDisplayName = new DelDisplayName(DisplayName); objDelSendMsg = new DelSendMessage(delSendMessage); objDelSignOutMsg = new DelSignOutMessage(delSignoutMessage); objDelSendPeerMsg = new DelSendPeerMessage(delSendPeerMessage); objDelGetUserList = new DelGetUserList(delGetUserList); objDelUserTypeing = new DelShowUserTypeing(delShowUserTypeMessage); objDelTextDownEvent = new DelTextDownEvent(delTextDownEvent); objDelAsyncGetMessage = new DelAsyncGetMessage(delAsyncGetMessage); } catch (Exception ex) { MessageBox.Show("GlobalVariable" + ex.Message); } }