示例#1
0
文件: Http.cs 项目: jasegiffin/JustUO
		public static void InvokeSend(HttpInfo info, HttpWebRequest request)
		{
			if (info == null || request == null)
			{
				return;
			}

			if (OnSend != null)
			{
				OnSend(info, request);
			}
		}
示例#2
0
		public static void Register(HttpInfo info, HttpWebRequest request)
		{
			if (info == null || request == null)
			{
				return;
			}

			if (!Requests.ContainsKey(info))
			{
				Requests.Add(info, new List<HttpWebRequest>());
			}

			Requests[info].Add(request);
		}
示例#3
0
文件: Http.cs 项目: jasegiffin/JustUO
		public static void Register(HttpInfo info, HttpWebRequest request)
		{
			if (info == null || request == null)
			{
				return;
			}

			Requests.AddOrReplace(
				info,
				list =>
				{
					list = list ?? new List<HttpWebRequest>();
					list.AddOrReplace(request);
					return list;
				});
		}
示例#4
0
		public static bool Unregister(HttpInfo info, HttpWebRequest request)
		{
			bool retVal = false;

			if (Requests.ContainsKey(info))
			{
				retVal = Requests[info].Remove(request);

				if (Requests[info].Count == 0)
				{
					Requests.Remove(info);
				}
			}

			return retVal;
		}
示例#5
0
文件: Http.cs 项目: jasegiffin/JustUO
		public static bool Unregister(HttpInfo info, HttpWebRequest request)
		{
			bool retVal = false;

			var list = Requests.GetValue(info);

			if (list != null)
			{
				retVal = list.Remove(request);

				list.Free(false);

				if (list.Count == 0)
				{
					Requests.Remove(info);
				}
			}

			return retVal;
		}
示例#6
0
文件: Http.cs 项目: jasegiffin/JustUO
		public static void InvokeReceive(HttpInfo info, HttpWebRequest request, HttpWebResponse response)
		{
			if (info == null || request == null || response == null)
			{
				return;
			}

			if (OnReceive != null)
			{
				OnReceive(info, request, response);
			}
		}