C# Класс WebSocketSharp.Server.WebSocketServiceHostManager

Manages the WebSocket services provided by the HttpServer and WebSocketServer.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Broadcast ( byte data ) : void

Broadcasts a binary data to all clients of the WebSocket services provided by the server.

Broadcast ( string data ) : void

Broadcasts a text data to all clients of the WebSocket services provided by the server.

BroadcastAsync ( System.Stream stream, int length, System.Action completed ) : void

Broadcasts a binary data from the specified Stream asynchronously to all clients of the WebSocket services provided by the server.

This method doesn't wait for the broadcast to be complete.

BroadcastAsync ( byte data, System.Action completed ) : void

Broadcasts a binary data asynchronously to all clients of the WebSocket services provided by the server.

This method doesn't wait for the broadcast to be complete.

BroadcastAsync ( string data, System.Action completed ) : void

Broadcasts a text data asynchronously to all clients of the WebSocket services provided by the server.

This method doesn't wait for the broadcast to be complete.

BroadcastTo ( string servicePath, byte data ) : void

Broadcasts a binary data to all clients of the WebSocket service with the specified servicePath.

BroadcastTo ( string servicePath, string data ) : void

Broadcasts a text data to all clients of the WebSocket service with the specified servicePath.

BroadcastToAsync ( string servicePath, System.Stream stream, int length, System.Action completed ) : void

Broadcasts a binary data from the specified Stream asynchronously to all clients of the WebSocket service with the specified servicePath.

This method doesn't wait for the broadcast to be complete.

BroadcastToAsync ( string servicePath, byte data, System.Action completed ) : void

Broadcasts a binary data asynchronously to all clients of the WebSocket service with the specified servicePath.

This method doesn't wait for the broadcast to be complete.

BroadcastToAsync ( string servicePath, string data, System.Action completed ) : void

Broadcasts a text data asynchronously to all clients of the WebSocket service with the specified servicePath.

This method doesn't wait for the broadcast to be complete.

Broadping ( ) : Dictionary>

Sends Pings to all clients of the WebSocket services provided by the server.

Broadping ( string message ) : Dictionary>

Sends Pings with the specified message to all clients of the WebSocket services provided by the server.

BroadpingTo ( string servicePath ) : bool>.Dictionary

Sends Pings to all clients of the WebSocket service with the specified servicePath.

BroadpingTo ( string servicePath, string message ) : bool>.Dictionary

Sends Pings with the specified message to all clients of the WebSocket service with the specified servicePath.

CloseSession ( string servicePath, string id ) : void

Closes the session with the specified servicePath and id.

CloseSession ( string servicePath, string id, CloseStatusCode code, string reason ) : void

Closes the session with the specified servicePath, id, code and reason.

CloseSession ( string servicePath, string id, ushort code, string reason ) : void

Closes the session with the specified servicePath, id, code and reason.

PingTo ( string servicePath, string id ) : bool

Sends a Ping to the client associated with the specified servicePath and id.

PingTo ( string servicePath, string id, string message ) : bool

Sends a Ping with the specified message to the client associated with the specified servicePath and id.

SendTo ( string servicePath, string id, byte data ) : void

Sends a binary data to the client on the session with the specified id, in the WebSocket service with the specified servicePath.

SendTo ( string servicePath, string id, string data ) : void

Sends a text data to the client on the session with the specified id, in the WebSocket service with the specified servicePath.

SendToAsync ( string servicePath, string id, System.Stream stream, int length, Action completed ) : void

Sends a binary data from the specified Stream asynchronously to the client on the session with the specified id, in the WebSocket service with the specified servicePath.

This method doesn't wait for the send to be complete.

SendToAsync ( string servicePath, string id, byte data, Action completed ) : void

Sends a binary data asynchronously to the client on the session with the specified id, in the WebSocket service with the specified servicePath.

This method doesn't wait for the send to be complete.

SendToAsync ( string servicePath, string id, string data, Action completed ) : void

Sends a text data asynchronously to the client on the session with the specified id, in the WebSocket service with the specified servicePath.

This method doesn't wait for the send to be complete.

TryGetServiceHost ( string servicePath, WebSocketSharp.Server.WebSocketServiceHost &serviceHost ) : bool

Tries to get a WebSocket service host with the specified servicePath.

this ( string servicePath ) : WebSocketSharp.Server.WebSocketServiceHost

Gets a WebSocket service host with the specified servicePath.

Приватные методы

Метод Описание
Add ( string servicePath, WebSocketSharp.Server.WebSocketServiceHost serviceHost ) : void
Remove ( string servicePath ) : bool
Start ( ) : void
Stop ( byte data, bool send ) : void
TryGetServiceHostInternally ( string servicePath, WebSocketSharp.Server.WebSocketServiceHost &serviceHost ) : bool
WebSocketServiceHostManager ( ) : System
WebSocketServiceHostManager ( System.Logger logger ) : System
broadcast ( Opcode opcode, System.Stream stream, System.Action completed ) : void
broadcast ( Opcode opcode, byte data, System.Action completed ) : void
broadcastAsync ( Opcode opcode, System.Stream stream, System.Action completed ) : void
broadcastAsync ( Opcode opcode, byte data, System.Action completed ) : void
broadping ( byte frameAsBytes, int timeOut ) : Dictionary>
checkIfCanSend ( Func checkParams ) : string

Описание методов

Broadcast() публичный Метод

Broadcasts a binary data to all clients of the WebSocket services provided by the server.
public Broadcast ( byte data ) : void
data byte /// An array of that represents the binary data /// to broadcast. ///
Результат void

Broadcast() публичный Метод

Broadcasts a text data to all clients of the WebSocket services provided by the server.
public Broadcast ( string data ) : void
data string /// A that represents the text data to broadcast. ///
Результат void

BroadcastAsync() публичный Метод

Broadcasts a binary data from the specified Stream asynchronously to all clients of the WebSocket services provided by the server.
This method doesn't wait for the broadcast to be complete.
public BroadcastAsync ( System.Stream stream, int length, System.Action completed ) : void
stream System.Stream /// A from which contains the binary data to broadcast. ///
length int /// An that represents the number of bytes to broadcast. ///
completed System.Action /// A delegate that references the method(s) called when /// the broadcast is complete. ///
Результат void

BroadcastAsync() публичный Метод

Broadcasts a binary data asynchronously to all clients of the WebSocket services provided by the server.
This method doesn't wait for the broadcast to be complete.
public BroadcastAsync ( byte data, System.Action completed ) : void
data byte /// An array of that represents the binary data /// to broadcast. ///
completed System.Action /// A delegate that references the method(s) called when /// the broadcast is complete. ///
Результат void

BroadcastAsync() публичный Метод

Broadcasts a text data asynchronously to all clients of the WebSocket services provided by the server.
This method doesn't wait for the broadcast to be complete.
public BroadcastAsync ( string data, System.Action completed ) : void
data string /// A that represents the text data to broadcast. ///
completed System.Action /// A delegate that references the method(s) called when /// the broadcast is complete. ///
Результат void

BroadcastTo() публичный Метод

Broadcasts a binary data to all clients of the WebSocket service with the specified servicePath.
public BroadcastTo ( string servicePath, byte data ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
data byte /// An array of that represents the binary data /// to broadcast. ///
Результат void

BroadcastTo() публичный Метод

Broadcasts a text data to all clients of the WebSocket service with the specified servicePath.
public BroadcastTo ( string servicePath, string data ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
data string /// A that represents the text data to broadcast. ///
Результат void

BroadcastToAsync() публичный Метод

Broadcasts a binary data from the specified Stream asynchronously to all clients of the WebSocket service with the specified servicePath.
This method doesn't wait for the broadcast to be complete.
public BroadcastToAsync ( string servicePath, System.Stream stream, int length, System.Action completed ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
stream System.Stream /// A from which contains the binary data to broadcast. ///
length int /// An that represents the number of bytes to broadcast. ///
completed System.Action /// A delegate that references the method(s) called when /// the broadcast is complete. ///
Результат void

BroadcastToAsync() публичный Метод

Broadcasts a binary data asynchronously to all clients of the WebSocket service with the specified servicePath.
This method doesn't wait for the broadcast to be complete.
public BroadcastToAsync ( string servicePath, byte data, System.Action completed ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
data byte /// An array of that represents the binary data /// to broadcast. ///
completed System.Action /// A delegate that references the method(s) called when /// the broadcast is complete. ///
Результат void

BroadcastToAsync() публичный Метод

Broadcasts a text data asynchronously to all clients of the WebSocket service with the specified servicePath.
This method doesn't wait for the broadcast to be complete.
public BroadcastToAsync ( string servicePath, string data, System.Action completed ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
data string /// A that represents the text data to broadcast. ///
completed System.Action /// A delegate that references the method(s) called when /// the broadcast is complete. ///
Результат void

Broadping() публичный Метод

Sends Pings to all clients of the WebSocket services provided by the server.
public Broadping ( ) : Dictionary>
Результат Dictionary>

Broadping() публичный Метод

Sends Pings with the specified message to all clients of the WebSocket services provided by the server.
public Broadping ( string message ) : Dictionary>
message string /// A that represents the message to broadcast. ///
Результат Dictionary>

BroadpingTo() публичный Метод

Sends Pings to all clients of the WebSocket service with the specified servicePath.
public BroadpingTo ( string servicePath ) : bool>.Dictionary
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
Результат bool>.Dictionary

BroadpingTo() публичный Метод

Sends Pings with the specified message to all clients of the WebSocket service with the specified servicePath.
public BroadpingTo ( string servicePath, string message ) : bool>.Dictionary
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
message string /// A that represents the message to send. ///
Результат bool>.Dictionary

CloseSession() публичный Метод

Closes the session with the specified servicePath and id.
public CloseSession ( string servicePath, string id ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
id string /// A that represents the ID of the session to close. ///
Результат void

CloseSession() публичный Метод

Closes the session with the specified servicePath, id, code and reason.
public CloseSession ( string servicePath, string id, CloseStatusCode code, string reason ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
id string /// A that represents the ID of the session to close. ///
code CloseStatusCode /// One of the values that indicate the status /// codes for closure. ///
reason string /// A that represents the reason for closure. ///
Результат void

CloseSession() публичный Метод

Closes the session with the specified servicePath, id, code and reason.
public CloseSession ( string servicePath, string id, ushort code, string reason ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
id string /// A that represents the ID of the session to close. ///
code ushort /// A that represents the status code for closure. ///
reason string /// A that represents the reason for closure. ///
Результат void

PingTo() публичный Метод

Sends a Ping to the client associated with the specified servicePath and id.
public PingTo ( string servicePath, string id ) : bool
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
id string /// A that represents the ID of the session to send the /// Ping to. ///
Результат bool

PingTo() публичный Метод

Sends a Ping with the specified message to the client associated with the specified servicePath and id.
public PingTo ( string servicePath, string id, string message ) : bool
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
id string /// A that represents the ID of the session to send the /// Ping to. ///
message string /// A that represents the message to send. ///
Результат bool

SendTo() публичный Метод

Sends a binary data to the client on the session with the specified id, in the WebSocket service with the specified servicePath.
public SendTo ( string servicePath, string id, byte data ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
id string /// A that represents the ID of the session to find. ///
data byte /// An array of that represents the binary data to send. ///
Результат void

SendTo() публичный Метод

Sends a text data to the client on the session with the specified id, in the WebSocket service with the specified servicePath.
public SendTo ( string servicePath, string id, string data ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
id string /// A that represents the ID of the session to find. ///
data string /// A that represents the text data to send. ///
Результат void

SendToAsync() публичный Метод

Sends a binary data from the specified Stream asynchronously to the client on the session with the specified id, in the WebSocket service with the specified servicePath.
This method doesn't wait for the send to be complete.
public SendToAsync ( string servicePath, string id, System.Stream stream, int length, Action completed ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
id string /// A that represents the ID of the session to find. ///
stream System.Stream /// A from which contains the binary data to send. ///
length int /// An that represents the number of bytes to send. ///
completed Action /// An Action<bool> delegate that references the method(s) called when /// the send is complete. /// A passed to this delegate is true if the send is /// complete successfully; otherwise, false. ///
Результат void

SendToAsync() публичный Метод

Sends a binary data asynchronously to the client on the session with the specified id, in the WebSocket service with the specified servicePath.
This method doesn't wait for the send to be complete.
public SendToAsync ( string servicePath, string id, byte data, Action completed ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
id string /// A that represents the ID of the session to find. ///
data byte /// An array of that represents the binary data to send. ///
completed Action /// An Action<bool> delegate that references the method(s) called when /// the send is complete. /// A passed to this delegate is true if the send is /// complete successfully; otherwise, false. ///
Результат void

SendToAsync() публичный Метод

Sends a text data asynchronously to the client on the session with the specified id, in the WebSocket service with the specified servicePath.
This method doesn't wait for the send to be complete.
public SendToAsync ( string servicePath, string id, string data, Action completed ) : void
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
id string /// A that represents the ID of the session to find. ///
data string /// A that represents the text data to send. ///
completed Action /// An Action<bool> delegate that references the method(s) called when /// the send is complete. /// A passed to this delegate is true if the send is /// complete successfully; otherwise, false. ///
Результат void

TryGetServiceHost() публичный Метод

Tries to get a WebSocket service host with the specified servicePath.
public TryGetServiceHost ( string servicePath, WebSocketSharp.Server.WebSocketServiceHost &serviceHost ) : bool
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
serviceHost WebSocketSharp.Server.WebSocketServiceHost /// When this method returns, a instance /// that represents the WebSocket service host if it's successfully found; /// otherwise, . This parameter is passed uninitialized. ///
Результат bool

this() публичный Метод

Gets a WebSocket service host with the specified servicePath.
public this ( string servicePath ) : WebSocketSharp.Server.WebSocketServiceHost
servicePath string /// A that represents the absolute path to the WebSocket /// service to find. ///
Результат WebSocketSharp.Server.WebSocketServiceHost