SkyWay Unity SDK
公式APIリファレンス
読み取り中…
検索中…
一致する文字列を見つけられません
WebSocketSharp.Server.WebSocketServiceManager クラス

Provides the management function for the WebSocket services. [詳解]

公開メンバ関数

void AddService< TBehavior > (string path, Action< TBehavior > initializer)
 Adds a WebSocket service with the specified behavior, path, and initializer.
 
void Clear ()
 Removes all WebSocket services managed by the manager.
 
bool RemoveService (string path)
 Removes a WebSocket service with the specified path.
 
bool TryGetServiceHost (string path, out WebSocketServiceHost host)
 Tries to get the service host instance for a WebSocket service with the specified path.
 

プロパティ

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.

引数
pathA string that specifies an absolute path to the service to add. / is trimmed from the end of the string if present.
initializerAn T:System.Action<TBehavior> delegate. It specifies the delegate called when the service initializes a new session instance. null if not necessary.
テンプレート引数
TBehaviorThe type of the behavior for the service. It must inherit the WebSocketBehavior class. Also it must have a public parameterless constructor.
例外
ArgumentExceptionpath 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.
ArgumentNullExceptionpath 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.
引数
pathA string that specifies an absolute path to the service to remove. / is trimmed from the end of the string if present.
例外
ArgumentExceptionpath is an empty string. -or- path is not an absolute path. -or- path includes either or both query and fragment components.
ArgumentNullExceptionpath 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.
引数
pathA string that specifies an absolute path to the service to get. / is trimmed from the end of the string if present.
hostWhen 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.
例外
ArgumentExceptionpath is an empty string. -or- path is not an absolute path. -or- path includes either or both query and fragment components.
ArgumentNullExceptionpath 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.

引数
pathA string that specifies an absolute path to the service to get. / is trimmed from the end of the string if present.
例外
ArgumentExceptionpath is an empty string. -or- path is not an absolute path. -or- path includes either or both query and fragment components.
ArgumentNullExceptionpath 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.

例外
ArgumentOutOfRangeExceptionThe value specified for a set operation is zero or less.

このクラス詳解は次のファイルから抽出されました: