• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Net.HttpListenerContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中WebSocketSharp.Net.HttpListenerContext的典型用法代码示例。如果您正苦于以下问题:C# HttpListenerContext类的具体用法?C# HttpListenerContext怎么用?C# HttpListenerContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HttpListenerContext类属于WebSocketSharp.Net命名空间,在下文中一共展示了HttpListenerContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: RegisterContext

        internal bool RegisterContext(HttpListenerContext context)
        {
            if (!_listening)
            return false;

              lock (_ctxRegistrySync) {
            if (!_listening)
              return false;

            _ctxRegistry[context] = context;

            var ares = getAsyncResultFromQueue ();
            if (ares == null)
              _ctxQueue.Add (context);
            else
              ares.Complete (context);

            return true;
              }
        }
开发者ID:jogibear9988,项目名称:websocket-sharp,代码行数:20,代码来源:HttpListener.cs


示例17: UnregisterContext

        internal void UnregisterContext(HttpListenerContext context)
        {
            lock (((ICollection)registry).SyncRoot)
                registry.Remove (context);

            lock (((ICollection)ctx_queue).SyncRoot) {
                int idx = ctx_queue.IndexOf (context);
                if (idx >= 0)
                    ctx_queue.RemoveAt (idx);
            }
        }
开发者ID:kallex,项目名称:websocket-sharp,代码行数:11,代码来源:HttpListener.cs


示例18: UnregisterContext

 internal void UnregisterContext(HttpListenerContext context)
 {
     lock (_ctxRegistrySync)
     _ctxRegistry.Remove (context);
 }
开发者ID:jogibear9988,项目名称:websocket-sharp,代码行数:5,代码来源:HttpListener.cs


示例19: ResponseEventArgs

 public ResponseEventArgs(HttpListenerContext context)
 {
     Request  = context.Request;
       Response = context.Response;
 }
开发者ID:wdnz,项目名称:websocket-sharp,代码行数:5,代码来源:ResponseEventArgs.cs


示例20: Complete

    internal void Complete (HttpListenerContext context, bool syncCompleted)
    {
      var lsnr = context.Listener;
      if (!lsnr.Authenticate (context)) {
        lsnr.BeginGetContext (this);
        return;
      }

      _context = context;
      _syncCompleted = syncCompleted;

      lock (_sync)
        complete (this);
    }
开发者ID:rjansen,项目名称:unity-ws-demo,代码行数:14,代码来源:HttpListenerAsyncResult.cs



注:本文中的WebSocketSharp.Net.HttpListenerContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DatabaseManager.SqlCeDataManager类代码示例发布时间:2022-05-26
下一篇:
C# WebSocketSharp.WebSocket类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap