当前位置: 首页>>代码示例>>C#>>正文


C# UvStreamHandle.Accept方法代码示例

本文整理汇总了C#中Microsoft.AspNet.Server.Kestrel.Networking.UvStreamHandle.Accept方法的典型用法代码示例。如果您正苦于以下问题:C# UvStreamHandle.Accept方法的具体用法?C# UvStreamHandle.Accept怎么用?C# UvStreamHandle.Accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.AspNet.Server.Kestrel.Networking.UvStreamHandle的用法示例。


在下文中一共展示了UvStreamHandle.Accept方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnConnection

        /// <summary>
        /// Handles an incoming connection
        /// </summary>
        /// <param name="listenSocket">Socket being used to listen on</param>
        /// <param name="status">Connection status</param>
        protected override void OnConnection(UvStreamHandle listenSocket, int status)
        {
            var acceptSocket = new UvPipeHandle(Log);
            acceptSocket.Init(Thread.Loop, false);

            try
            {
                listenSocket.Accept(acceptSocket);
            }
            catch (UvException ex)
            {
                Log.LogError("PipeListener.OnConnection", ex);
                return;
            }

            DispatchConnection(acceptSocket);
        }
开发者ID:Starcounter,项目名称:KestrelHttpServer,代码行数:22,代码来源:PipeListener.cs

示例2: OnConnection

        /// <summary>
        /// Handles an incoming connection
        /// </summary>
        /// <param name="listenSocket">Socket being used to listen on</param>
        /// <param name="status">Connection status</param>
        protected override void OnConnection(UvStreamHandle listenSocket, int status)
        {
            var acceptSocket = new UvTcpHandle(Log);
            acceptSocket.Init(Thread.Loop, Thread.QueueCloseHandle);

            try
            {
                listenSocket.Accept(acceptSocket);
            }
            catch (UvException ex)
            {
                Log.LogError("TcpListenerPrimary.OnConnection", ex);
                return;
            }

            DispatchConnection(acceptSocket);
        }
开发者ID:rogeralsing,项目名称:KestrelHttpServer,代码行数:22,代码来源:TcpListenerPrimary.cs

示例3: OnListenPipe

        private void OnListenPipe(UvStreamHandle pipe, int status, Exception error, object state)
        {
            if (status < 0)
            {
                return;
            }

            var dispatchPipe = new UvPipeHandle();
            dispatchPipe.Init(Thread.Loop, true);
            try
            {
                pipe.Accept(dispatchPipe);
            }
            catch (Exception)
            {
                dispatchPipe.Dispose();
                return;
            }
            _dispatchPipes.Add(dispatchPipe);
        }
开发者ID:justkao,项目名称:KestrelHttpServer,代码行数:20,代码来源:ListenerPrimary.cs

示例4: OnListenPipe

        private void OnListenPipe(UvStreamHandle pipe, int status, Exception error)
        {
            if (status < 0)
            {
                return;
            }

            var dispatchPipe = new UvPipeHandle(Log);
            dispatchPipe.Init(Thread.Loop, true);

            try
            {
                pipe.Accept(dispatchPipe);
            }
            catch (UvException ex)
            {
                dispatchPipe.Dispose();
                Log.LogError("ListenerPrimary.OnListenPipe", ex);
                return;
            }

            _dispatchPipes.Add(dispatchPipe);
        }
开发者ID:leloulight,项目名称:KestrelHttpServer,代码行数:23,代码来源:ListenerPrimary.cs

示例5: OnConnection

        private void OnConnection(UvStreamHandle listenSocket, int status)
        {
            var acceptSocket = new UvTcpHandle();
            acceptSocket.Init(Thread.Loop, Thread.QueueCloseHandle);
            listenSocket.Accept(acceptSocket);

            var connection = new Connection(this, acceptSocket);
            connection.Start();
        }
开发者ID:fakedob,项目名称:KestrelHttpServer,代码行数:9,代码来源:Listener.cs


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