src/packages/EmbedIO/WebSockets/WebSocketModule.cs
/// <summary>
/// Adds a WebSocket subprotocol to the list of protocols supported by a <see cref="WebSocketModule"/>.
/// </summary>
/// <param name="protocol">The protocol name to add to the list.</param>
/// <exception cref="ArgumentNullException"><paramref name="protocol"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentException">
/// <para><paramref name="protocol"/> contains one or more invalid characters, as defined
/// in <see href="https://tools.ietf.org/html/rfc6455#section-4.3">RFC6455, Section 4.3</see>.</para>
/// <para>- or -</para>
/// <para><paramref name="protocol"/> is already in the list of supported protocols.</para>
/// </exception>
/// <exception cref="InvalidOperationException">The <see cref="WebSocketModule"/> has already been started.</exception>
/// <seealso cref="Validate.Rfc2616Token"/>
/// <seealso cref="AddProtocols(IEnumerable{string})"/>
/// <seealso cref="AddProtocols(string[])"/>
Adds a WebSocket subprotocol to the list of protocols supported by a .
Adds a WebSocket subprotocol to the list of protocols supported by a .
protected void AddProtocol(string protocol)
        {
            protocol = Validate.Rfc2616Token(nameof(protocol), protocol, "Protocol name");
            EnsureConfigurationNotLocked();
            if (_protocols.Contains(protocol))
                throw new ArgumentException("Duplicate WebSocket protocol name.", nameof(protocol));
            _protocols.Add(protocol);
        }
protected void AddProtocol ( string protocol ) { protocol = Validate . Rfc2616Token ( nameof ( protocol ) , protocol , " " ) ; EnsureConfigurationNotLocked ( ) ; if ( _protocols . Contains ( protocol ) ) throw new ArgumentException ( " " , nameof ( protocol ) ) ; _protocols . Add ( protocol ) ; }
Adds a WebSocket subprotocol to the list of protocols supported by a .
Adds a WebSocket subprotocol to the list of protocols supported by a .
None
contains one or more invalid characters, as defined
in RFC6455, Section 4.3- or - is already in the list of supported protocols.
contains one or more invalid characters as defined in RFC6455 Section 4 . 3 - or - is already in the list of supported protocols .
The  has already been started.
The has already been started .
protocol
string
The protocol name to add to the list.
The protocol name to add to the list .
seealso
None
seealso
None
seealso
None