當前位置: 首頁>>代碼示例>>C#>>正文


C# HttpWorkerRequest.GetLocalAddress方法代碼示例

本文整理匯總了C#中System.Web.HttpWorkerRequest.GetLocalAddress方法的典型用法代碼示例。如果您正苦於以下問題:C# HttpWorkerRequest.GetLocalAddress方法的具體用法?C# HttpWorkerRequest.GetLocalAddress怎麽用?C# HttpWorkerRequest.GetLocalAddress使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Web.HttpWorkerRequest的用法示例。


在下文中一共展示了HttpWorkerRequest.GetLocalAddress方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CanExecuteRequest

		bool CanExecuteRequest (HttpWorkerRequest req)
		{
			if (disposing)
				return false;
				
			int threads, cports;
			ThreadPool.GetAvailableThreads (out threads, out cports);
			bool local = (req != null && req.GetLocalAddress () == "127.0.0.1");
			return (threads > minFree) || (local && threads > minLocalFree);
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:10,代碼來源:QueueManager.cs

示例2: IsLocal

        // helpers
        private static bool IsLocal(HttpWorkerRequest wr) {
            String remoteAddress = wr.GetRemoteAddress();

            // check if localhost
            if (remoteAddress == "127.0.0.1" || remoteAddress == "::1")
                return true;

            // if unknown, assume not local
            if (String.IsNullOrEmpty(remoteAddress))
                return false;

            // compare with local address
            if (remoteAddress == wr.GetLocalAddress())
                return true;

            return false;
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:18,代碼來源:RequestQueue.cs

示例3: CanExecuteRequest

		bool CanExecuteRequest (HttpWorkerRequest req)
		{
			if (disposing)
				return false;
				
#if TARGET_J2EE
			return true; // The J2EE app server manages the thread pool
#else
			int threads, cports;
			ThreadPool.GetAvailableThreads (out threads, out cports);
			bool local = (req != null && req.GetLocalAddress () == "127.0.0.1");
			return (threads > minFree) || (local && threads > minLocalFree);
#endif
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:14,代碼來源:QueueManager.cs

示例4: IsLocal

 private static bool IsLocal(HttpWorkerRequest wr)
 {
     string remoteAddress = wr.GetRemoteAddress();
     switch (remoteAddress)
     {
         case "127.0.0.1":
         case "::1":
             return true;
     }
     if (string.IsNullOrEmpty(remoteAddress))
     {
         return false;
     }
     return (remoteAddress == wr.GetLocalAddress());
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:15,代碼來源:RequestQueue.cs


注:本文中的System.Web.HttpWorkerRequest.GetLocalAddress方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。