예제 #1
0
        static async Task Acceptor(HttpContext hc, Func <Task> n)
        {
            if (!hc.WebSockets.IsWebSocketRequest)
            {
                return;
            }

            Console.WriteLine("---> Creating WebSocket");

            var socket = await hc.WebSockets.AcceptWebSocketAsync();

            var h = new SocketHandler(socket);
            await h.WorkLoop();
        }
예제 #2
0
        static async Task Acceptor(HttpContext hc, Func <Task> n)
        {
            if (!hc.WebSockets.IsWebSocketRequest)
            {
                return;
            }

            var socket = await hc.WebSockets.AcceptWebSocketAsync();

            var h = new SocketHandler(socket);
            //await h.EchoLoop();

            await h.Send();
        }