Example #1
0
 /// <summary>
 /// Adds a WebSocket service with the specified behavior and path.
 /// </summary>
 /// <param name="path">
 ///   <para>
 ///   A <see cref="string"/> that specifies an absolute path to
 ///   the service to add.
 ///   </para>
 ///   <para>
 ///   / is trimmed from the end of the string if present.
 ///   </para>
 /// </param>
 /// <typeparam name="TBehavior">
 ///   <para>
 ///   The type of the behavior for the service.
 ///   </para>
 ///   <para>
 ///   It must inherit the <see cref="WebSocketBehavior"/> class.
 ///   </para>
 ///   <para>
 ///   And also, it must have a public parameterless constructor.
 ///   </para>
 /// </typeparam>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="path"/> is <see langword="null"/>.
 /// </exception>
 /// <exception cref="ArgumentException">
 ///   <para>
 ///   <paramref name="path"/> is an empty string.
 ///   </para>
 ///   <para>
 ///   -or-
 ///   </para>
 ///   <para>
 ///   <paramref name="path"/> is not an absolute path.
 ///   </para>
 ///   <para>
 ///   -or-
 ///   </para>
 ///   <para>
 ///   <paramref name="path"/> includes either or both
 ///   query and fragment components.
 ///   </para>
 ///   <para>
 ///   -or-
 ///   </para>
 ///   <para>
 ///   <paramref name="path"/> is already in use.
 ///   </para>
 /// </exception>
 public void AddWebSocketService <TBehavior> (string path)
     where TBehavior : WebSocketBehavior, new ()
 {
     _services.AddService <TBehavior> (path, null);
 }