Provides the management function for the WebSocket services.
[詳解]
|
int | Count [get] |
| Gets the number of the WebSocket services.
|
|
IEnumerable< WebSocketServiceHost > | Hosts [get] |
| Gets the service host instances for the WebSocket services.
|
|
WebSocketServiceHost | this[string path] [get] |
| Gets the service host instance for a WebSocket service with the specified path.
|
|
bool | KeepClean [get, set] |
| Gets or sets a value indicating whether the inactive sessions in the WebSocket services are cleaned up periodically.
|
|
IEnumerable< string > | Paths [get] |
| Gets the paths for the WebSocket services.
|
|
TimeSpan | WaitTime [get, set] |
| Gets or sets the time to wait for the response to the WebSocket Ping or Close.
|
|
Provides the management function for the WebSocket services.
This class manages the WebSocket services provided by the WebSocketServer or HttpServer class.
◆ AddService< TBehavior >()
void WebSocketSharp.Server.WebSocketServiceManager.AddService< TBehavior > |
( |
string | path, |
|
|
Action< TBehavior > | initializer ) |
|
inline |
Adds a WebSocket service with the specified behavior, path, and initializer.
- 引数
-
path | A string that specifies an absolute path to the service to add. / is trimmed from the end of the string if present. |
initializer | An T:System.Action<TBehavior> delegate. It specifies the delegate called when the service initializes a new session instance. null if not necessary. |
- テンプレート引数
-
TBehavior | The type of the behavior for the service. It must inherit the WebSocketBehavior class. Also it must have a public parameterless constructor. |
- 例外
-
ArgumentException | path is an empty string. -or- path is not an absolute path. -or- path includes either or both query and fragment components. -or- path is already in use. |
ArgumentNullException | path is null . |
- 型制約
-
TBehavior | : | WebSocketBehavior | |
TBehavior | : | new | |
◆ Clear()
void WebSocketSharp.Server.WebSocketServiceManager.Clear |
( |
| ) |
|
|
inline |
Removes all WebSocket services managed by the manager.
Each service is stopped with close status 1001 (going away) if the current state of the service is Start.
◆ RemoveService()
bool WebSocketSharp.Server.WebSocketServiceManager.RemoveService |
( |
string | path | ) |
|
|
inline |
Removes a WebSocket service with the specified path.
The service is stopped with close status 1001 (going away) if the current state of the service is Start.
- 戻り値
true
if the service is successfully found and removed; otherwise, false
.
- 引数
-
path | A string that specifies an absolute path to the service to remove. / is trimmed from the end of the string if present. |
- 例外
-
ArgumentException | path is an empty string. -or- path is not an absolute path. -or- path includes either or both query and fragment components. |
ArgumentNullException | path is null . |
◆ TryGetServiceHost()
bool WebSocketSharp.Server.WebSocketServiceManager.TryGetServiceHost |
( |
string | path, |
|
|
out WebSocketServiceHost | host ) |
|
inline |
Tries to get the service host instance for a WebSocket service with the specified path.
- 戻り値
true
if the try has succeeded; otherwise, false
.
- 引数
-
path | A string that specifies an absolute path to the service to get. / is trimmed from the end of the string if present. |
host | When this method returns, a WebSocketServiceHost instance that receives the service host instance. It provides the function to access the information in the service. null if not found. |
- 例外
-
ArgumentException | path is an empty string. -or- path is not an absolute path. -or- path includes either or both query and fragment components. |
ArgumentNullException | path is null . |
◆ Count
int WebSocketSharp.Server.WebSocketServiceManager.Count |
|
get |
Gets the number of the WebSocket services.
An int that represents the number of the services.
◆ Hosts
IEnumerable<WebSocketServiceHost> WebSocketSharp.Server.WebSocketServiceManager.Hosts |
|
get |
Gets the service host instances for the WebSocket services.
An T:System.Collections.Generic.IEnumerable<WebSocketServiceHost> instance.
It provides an enumerator which supports the iteration over the collection of the service host instances.
◆ KeepClean
bool WebSocketSharp.Server.WebSocketServiceManager.KeepClean |
|
getset |
Gets or sets a value indicating whether the inactive sessions in the WebSocket services are cleaned up periodically.
The set operation works if the current state of the server is Ready or Stop.
true
if the inactive sessions are cleaned up every 60 seconds; otherwise, false
.
The default value is false
.
◆ Paths
IEnumerable<string> WebSocketSharp.Server.WebSocketServiceManager.Paths |
|
get |
Gets the paths for the WebSocket services.
An T:System.Collections.Generic.IEnumerable<string> instance.
It provides an enumerator which supports the iteration over the collection of the paths.
◆ this[string path]
WebSocketServiceHost WebSocketSharp.Server.WebSocketServiceManager.this[string path] |
|
get |
Gets the service host instance for a WebSocket service with the specified path.
A WebSocketServiceHost instance that represents the service host instance.
It provides the function to access the information in the service.
null
if not found.
- 引数
-
path | A string that specifies an absolute path to the service to get. / is trimmed from the end of the string if present. |
- 例外
-
ArgumentException | path is an empty string. -or- path is not an absolute path. -or- path includes either or both query and fragment components. |
ArgumentNullException | path is null . |
◆ WaitTime
TimeSpan WebSocketSharp.Server.WebSocketServiceManager.WaitTime |
|
getset |
Gets or sets the time to wait for the response to the WebSocket Ping or Close.
The set operation works if the current state of the server is Ready or Stop.
A TimeSpan that represents the time to wait for the response.
The default value is the same as 1 second.
- 例外
-
ArgumentOutOfRangeException | The value specified for a set operation is zero or less. |
このクラス詳解は次のファイルから抽出されました:
- SkyWayUnitySDK/Assets/SkyWay/Scripts/Deps/websocket-sharp/websocket-sharp/Server/WebSocketServiceManager.cs