当前位置: 首页>>代码示例>>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;未经允许,请勿转载。