コード例 #1
0
ファイル: ChatService.cs プロジェクト: wangws556/duoduogit
        public bool RoomLogin()
        {
            string publicIp = GetClientRemoteEndPoint().Address;

            try
            {
                if (roomCache.ContainsKey(publicIp))
                {
                    var r = roomCache[publicIp];
                    roomCache.Remove(publicIp);
                    roomCache[publicIp].Callback.RoomRelogin();
                    roomCache[publicIp].ServiceInstance.Dispose();
                }
            }
            catch { }
            OperationContext.Current.Channel.Faulted += RoomChannel_Faulted;
            OperationContext.Current.Channel.Closing += RoomChannel_Closing;
            rnc = new RoomNCallback
            {
                Callback        = OperationContext.Current.GetCallbackChannel <IChatServiceCallback>(),
                PublicIpAddress = publicIp,
                ServiceInstance = this
            };
            roomCache.Add(publicIp, rnc);
            return(true);
        }
コード例 #2
0
ファイル: ChatService.cs プロジェクト: wangws556/duoduogit
 private void Dispose(bool disposing)
 {
     if (!disposed)
     {
         if (disposing)
         {
         }
         unc = null;
         rnc = null;
     }
 }
コード例 #3
0
ファイル: ChatService.cs プロジェクト: wangws556/duoduogit
 private void LogOff(RoomNCallback roomNC)
 {
     roomCache.Remove(roomNC.PublicIpAddress);
     roomNC.ServiceInstance.Dispose();
 }
コード例 #4
0
 public bool RoomLogin()
 {
     string publicIp = GetClientRemoteEndPoint().Address;
     try
     {
         if (roomCache.ContainsKey(publicIp))
         {
             var r = roomCache[publicIp];
             roomCache.Remove(publicIp);
             roomCache[publicIp].Callback.RoomRelogin();
             roomCache[publicIp].ServiceInstance.Dispose();
         }
     }
     catch { }
     OperationContext.Current.Channel.Faulted += RoomChannel_Faulted;
     OperationContext.Current.Channel.Closing += RoomChannel_Closing;
     rnc = new RoomNCallback
     {
         Callback = OperationContext.Current.GetCallbackChannel<IChatServiceCallback>(),
         PublicIpAddress = publicIp,
         ServiceInstance = this
     };
     roomCache.Add(publicIp, rnc);
     return true;
 }
コード例 #5
0
		private void Dispose(bool disposing)
		{
			if (!disposed)
			{
				if (disposing)
				{
				}
                unc = null;
                rnc = null;
			}
		}
コード例 #6
0
 private void LogOff(RoomNCallback roomNC)
 {
     roomCache.Remove(roomNC.PublicIpAddress);
     roomNC.ServiceInstance.Dispose();
 }