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


C# Net.HttpListenerContext類代碼示例

本文整理匯總了C#中WebSocketSharp.Net.HttpListenerContext的典型用法代碼示例。如果您正苦於以下問題:C# HttpListenerContext類的具體用法?C# HttpListenerContext怎麽用?C# HttpListenerContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HttpListenerContext類屬於WebSocketSharp.Net命名空間,在下文中一共展示了HttpListenerContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: HttpListenerRequest

 internal HttpListenerRequest(HttpListenerContext context)
 {
     _context = context;
       _contentLength = -1;
       _headers = new WebHeaderCollection ();
       _identifier = Guid.NewGuid ();
 }
開發者ID:r-a-stone,項目名稱:websocket-sharp,代碼行數:7,代碼來源:HttpListenerRequest.cs

示例2: ChunkedRequestStream

 public ChunkedRequestStream (
   HttpListenerContext context, Stream stream, byte [] buffer, int offset, int length)
   : base (stream, buffer, offset, length)
 {
   _context = context;
   _decoder = new ChunkStream ((WebHeaderCollection) context.Request.Headers);
 }
開發者ID:JChan106,項目名稱:HACKPOLY16,代碼行數:7,代碼來源:ChunkedRequestStream.cs

示例3: ChunkedRequestStream

 internal ChunkedRequestStream (
   Stream stream, byte[] buffer, int offset, int count, HttpListenerContext context)
   : base (stream, buffer, offset, count)
 {
   _context = context;
   _decoder = new ChunkStream ((WebHeaderCollection) context.Request.Headers);
 }
開發者ID:FranKie-Ming,項目名稱:websocket-sharp,代碼行數:7,代碼來源:ChunkedRequestStream.cs

示例4: ProcessRequest

        //This gets called when the listener receives a request
        private void ProcessRequest (HttpListenerContext context)
        {
            var getContext = Task.Factory.FromAsync<HttpListenerContext>(_listener.BeginGetContext, _listener.EndGetContext, null);
            getContext.ContinueWith(t => ProcessRequest(t.Result));

            _router.HandleRequest(ContextGenerator(context));
        }
開發者ID:jonfunkhouser,項目名稱:couchbase-lite-net,代碼行數:8,代碼來源:CouchbaseLiteMockTcpListener.cs

示例5: ChunkedInputStream

        public ChunkedInputStream(
			HttpListenerContext context, Stream stream, byte [] buffer, int offset, int length)
            : base(stream, buffer, offset, length)
        {
            this.context = context;
            WebHeaderCollection coll = (WebHeaderCollection) context.Request.Headers;
            decoder = new ChunkStream (coll);
        }
開發者ID:richardfeng,項目名稱:UnitySocketIO-WebSocketSharp,代碼行數:8,代碼來源:ChunkedInputStream.cs

示例6: HttpListenerResponse

 internal HttpListenerResponse (HttpListenerContext context)
 {
   _context = context;
   _keepAlive = true;
   _statusCode = 200;
   _statusDescription = "OK";
   _version = HttpVersion.Version11;
 }
開發者ID:couchbasedeps,項目名稱:websocket-sharp,代碼行數:8,代碼來源:HttpListenerResponse.cs

示例7: InitTask

        private void InitTask(HttpListenerContext context)
        {
            try
            {
                var task = this.ProcessRequestAsync(context);
                task.ContinueWith(x => HandleError(x.Exception, context), TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.AttachedToParent);

                if (task.Status == TaskStatus.Created)
                {
                    task.RunSynchronously();
                }
            }
            catch (Exception ex)
            {
                HandleError(ex, context);
            }
        }
開發者ID:jmarsh0507,項目名稱:MediaBrowser,代碼行數:17,代碼來源:WebSocketSharpListener.cs

示例8: ProcessRequestAsync

        private Task ProcessRequestAsync(HttpListenerContext context)
        {
            var request = context.Request;

            LogHttpRequest(request);

            if (request.IsWebSocketRequest)
            {
                ProcessWebSocketRequest(context);
                return Task.FromResult(true);
            }

            if (string.IsNullOrEmpty(context.Request.RawUrl))
                return ((object)null).AsTaskResult();

            var httpReq = GetRequest(context);

            return RequestHandler(httpReq, request.Url);
        }
開發者ID:jmarsh0507,項目名稱:MediaBrowser,代碼行數:19,代碼來源:WebSocketSharpListener.cs

示例9: Complete

 internal void Complete (HttpListenerContext context)
 {
   Complete (context, false);
 }
開發者ID:songotony,項目名稱:RType-Client,代碼行數:4,代碼來源:ListenerAsyncResult.cs

示例10: CreateServerStream

 internal static WsStream CreateServerStream(HttpListenerContext context)
 {
     var conn = context.Connection;
       return new WsStream (conn.Stream, conn.IsSecure);
 }
開發者ID:richardfeng,項目名稱:UnitySocketIO-WebSocketSharp,代碼行數:5,代碼來源:WsStream.cs

示例11: Complete

        internal void Complete(HttpListenerContext context, bool syncCompleted)
        {
            var listener = context.Listener;
              var schm = listener.SelectAuthenticationScheme (context);
              if (schm != AuthenticationSchemes.Anonymous &&
              !authenticate (context, schm, listener.Realm, listener.UserCredentialsFinder)) {
            listener.BeginGetContext (this);
            return;
              }

              _context = context;
              _syncCompleted = syncCompleted;

              lock (_sync)
            complete (this);
        }
開發者ID:NVentimiglia,項目名稱:unity3d-plugin,代碼行數:16,代碼來源:HttpListenerAsyncResult.cs

示例12: CleanupContextRegistry

        void CleanupContextRegistry()
        {
            lock (((ICollection)registry).SyncRoot) {
                if (registry.Count == 0)
                    return;

                // Need to copy this since closing will call UnregisterContext
                ICollection keys = registry.Keys;
                var all = new HttpListenerContext [keys.Count];
                keys.CopyTo (all, 0);
                registry.Clear ();
                for (int i = all.Length - 1; i >= 0; i--)
                    all [i].Connection.Close (true);
            }
        }
開發者ID:kallex,項目名稱:websocket-sharp,代碼行數:15,代碼來源:HttpListener.cs

示例13: SelectAuthenticationScheme

 internal AuthenticationSchemes SelectAuthenticationScheme(HttpListenerContext context)
 {
     if (AuthenticationSchemeSelectorDelegate != null)
         return AuthenticationSchemeSelectorDelegate (context.Request);
     else
         return auth_schemes;
 }
開發者ID:kallex,項目名稱:websocket-sharp,代碼行數:7,代碼來源:HttpListener.cs

示例14: UnregisterContext

    internal void UnregisterContext (HttpListenerContext context)
    {
      lock (_ctxRegistrySync)
        _ctxRegistry.Remove (context);

      lock (_ctxQueueSync) {
        var idx = _ctxQueue.IndexOf (context);
        if (idx >= 0)
          _ctxQueue.RemoveAt (idx);
      }
    }
開發者ID:moby41,項目名稱:websocket-sharp,代碼行數:11,代碼來源:HttpListener.cs

示例15: RegisterContext

        internal void RegisterContext(HttpListenerContext context)
        {
            lock (((ICollection)registry).SyncRoot)
                registry [context] = context;

            ListenerAsyncResult ares = null;
            lock (((ICollection)wait_queue).SyncRoot) {
                if (wait_queue.Count == 0) {
                    lock (((ICollection)ctx_queue).SyncRoot)
                        ctx_queue.Add (context);
                } else {
                    ares = wait_queue [0];
                    wait_queue.RemoveAt (0);
                }
            }

            if (ares != null)
                ares.Complete (context);
        }
開發者ID:kallex,項目名稱:websocket-sharp,代碼行數:19,代碼來源:HttpListener.cs


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