/*
  * It receives a path and it maps that path using with the WebSocketManagerMiddleware
  * which is passed the specific implementation of WebSocketHandler you provided as argument for the MapWebSocketManager extension
  * method.
  * */
 public static IApplicationBuilder MapSockets(this IApplicationBuilder app, PathString path, SocketHandler socket)
 {
     return(app.Map(path, (x) => x.UseMiddleware <SocketMiddleware>(socket)));
 }
 public SocketMiddleware(RequestDelegate next, SocketHandler handler)
 {
     _next   = next;
     Handler = handler;
 }