[Modify] Remove it
This commit is contained in:
parent
e87dd17b5f
commit
4b75dab0dc
@ -1014,101 +1014,6 @@ namespace WebSocketSharp.Server
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Adds a WebSocket service with the specified behavior, path,
|
||||
/// and delegate.
|
||||
/// </summary>
|
||||
/// <param name="path">
|
||||
/// <para>
|
||||
/// A <see cref="string"/> that represents an absolute path to
|
||||
/// the service to add.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// / is trimmed from the end of the string if present.
|
||||
/// </para>
|
||||
/// </param>
|
||||
/// <param name="creator">
|
||||
/// <para>
|
||||
/// A <c>Func<TBehavior></c> delegate.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// It invokes the method called when creating a new session
|
||||
/// instance for the service.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The method must create a new instance of the specified
|
||||
/// behavior class and return it.
|
||||
/// </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>
|
||||
/// </typeparam>
|
||||
/// <exception cref="ArgumentNullException">
|
||||
/// <para>
|
||||
/// <paramref name="path"/> is <see langword="null"/>.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// -or-
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <paramref name="creator"/> is <see langword="null"/>.
|
||||
/// </para>
|
||||
/// </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>
|
||||
[Obsolete ("This method will be removed. Use added one instead.")]
|
||||
public void AddWebSocketService<TBehavior> (
|
||||
string path, Func<TBehavior> creator
|
||||
)
|
||||
where TBehavior : WebSocketBehavior
|
||||
{
|
||||
if (path == null)
|
||||
throw new ArgumentNullException ("path");
|
||||
|
||||
if (creator == null)
|
||||
throw new ArgumentNullException ("creator");
|
||||
|
||||
if (path.Length == 0)
|
||||
throw new ArgumentException ("An empty string.", "path");
|
||||
|
||||
if (path[0] != '/')
|
||||
throw new ArgumentException ("Not an absolute path.", "path");
|
||||
|
||||
if (path.IndexOfAny (new[] { '?', '#' }) > -1) {
|
||||
var msg = "It includes either or both query and fragment components.";
|
||||
throw new ArgumentException (msg, "path");
|
||||
}
|
||||
|
||||
_services.Add<TBehavior> (path, creator);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a WebSocket service with the specified behavior and path.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user