/// <summary> /// Add WebSocketsModule to WebServer /// </summary> /// <param name="webserver">The webserver instance.</param> /// <param name="assembly">The assembly to load Web Sockets from. Leave null to avoid autoloading.</param> /// <returns>The webserver instance.</returns> public static WebServer WithWebSocket(this WebServer webserver, Assembly assembly = null) { if (webserver == null) { throw new ArgumentException(Constants.ArgumentNullExceptionMessage, nameof(webserver)); } webserver.RegisterModule(new WebSocketsModule()); return((assembly != null) ? webserver.LoadWebSockets(assembly) : webserver); }
/// <summary> /// Add WebSocketsModule to WebServer /// </summary> /// <param name="webserver">The webserver instance.</param> /// <param name="assembly">The assembly to load Web Sockets from. Leave null to avoid autoloading.</param> /// <returns>The webserver instance.</returns> public static WebServer WithWebSocket(this WebServer webserver, Assembly assembly = null) { if (webserver == null) { throw new ArgumentException("Argument cannot be null.", "webserver"); } webserver.RegisterModule(new WebSocketsModule()); return((assembly != null) ? webserver.LoadWebSockets(assembly) : webserver); }