Beispiel #1
0
        private static WebSocketManager AddWebSocketManager(IAppBuilder appBuilder, WebSocketManager webSocketManager)
        {
            const string webSocketManagerKey = nameof(WebSocketManager);

            appBuilder.Properties.Add(webSocketManagerKey, webSocketManager);
            return(webSocketManager);
        }
Beispiel #2
0
 public WebSocketSharpMiddleware(OwinMiddleware next, WebSocketManager webSocketManager) : base(next)
 {
     _webSocketManager = webSocketManager;
 }
Beispiel #3
0
 public static IAppBuilder UseWebSockets(this IAppBuilder appBuilder, WebSocketManager webSocketManager)
 {
     AddWebSocketManager(appBuilder, webSocketManager);
     appBuilder.Use(typeof(WebSocketSharpMiddleware), webSocketManager);
     return(appBuilder);
 }