Ejemplo n.º 1
0
        public void AcceptWebSocketRequest(Func <IWebSocket, Task> callback)
        {
#if NET45
            _context.AcceptWebSocketRequest(ws =>
            {
                var handler = new AspNetWebSocketHandler();
                var task    = handler.ProcessWebSocketRequestAsync(ws);
                callback(handler).Then(h => h.CleanClose(), handler);
                return(task);
            });
#else
            throw new NotSupportedException();
#endif
        }
Ejemplo n.º 2
0
 public void AcceptWebSocketRequest(Func<IWebSocket, Task> callback)
 {
     #if NET45
     _context.AcceptWebSocketRequest(ws =>
     {
         var handler = new AspNetWebSocketHandler();
         var task = handler.ProcessWebSocketRequestAsync(ws);
         callback(handler).Then(h => h.CleanClose(), handler);
         return task;
     });
     #else
     throw new NotSupportedException();
     #endif
 }
Ejemplo n.º 3
0
 public void AcceptWebSocketRequest(Func<IWebSocket, Task> callback)
 {
     #if NET45
     _context.AcceptWebSocketRequest(ws =>
     {
         var handler = new AspNetWebSocketHandler();
         handler.ProcessWebSocketRequestAsync(ws);
         return callback(handler);
     });
     #endif
 }