diff --git a/websocket-sharp/Server/WebSocketServiceManager.cs b/websocket-sharp/Server/WebSocketServiceManager.cs
index 11852551..1915fb54 100644
--- a/websocket-sharp/Server/WebSocketServiceManager.cs
+++ b/websocket-sharp/Server/WebSocketServiceManager.cs
@@ -869,6 +869,28 @@ namespace WebSocketSharp.Server
return broadping (frame.ToArray (), _waitTime);
}
+ ///
+ /// Removes all WebSocket services managed by the manager.
+ ///
+ ///
+ /// A service is stopped with close status 1001 (going away)
+ /// if it has already started.
+ ///
+ public void Clear ()
+ {
+ List hosts = null;
+
+ lock (_sync) {
+ hosts = _hosts.Values.ToList ();
+ _hosts.Clear ();
+ }
+
+ foreach (var host in hosts) {
+ if (host.State == ServerState.Start)
+ host.Stop (1001, String.Empty);
+ }
+ }
+
///
/// Removes a WebSocket service with the specified .
///