C# Class WebSocketSharp.Server.WebSocketServiceHostManager

Manages the WebSocket services provided by the HttpServer and WebSocketServer.
Afficher le fichier Open project: uken/websocket-sharp Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

Broadcast() public méthode

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. ///
Résultat void

Broadcast() public méthode

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. ///
Résultat void

BroadcastAsync() public méthode

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. ///
Résultat void

BroadcastAsync() public méthode

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. ///
Résultat void

BroadcastAsync() public méthode

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. ///
Résultat void

BroadcastTo() public méthode

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. ///
Résultat void

BroadcastTo() public méthode

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. ///
Résultat void

BroadcastToAsync() public méthode

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. ///
Résultat void

BroadcastToAsync() public méthode

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. ///
Résultat void

BroadcastToAsync() public méthode

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. ///
Résultat void

Broadping() public méthode

Sends Pings to all clients of the WebSocket services provided by the server.
public Broadping ( ) : Dictionary>
Résultat Dictionary>

Broadping() public méthode

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. ///
Résultat Dictionary>

BroadpingTo() public méthode

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. ///
Résultat bool>.Dictionary

BroadpingTo() public méthode

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. ///
Résultat bool>.Dictionary

CloseSession() public méthode

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. ///
Résultat void

CloseSession() public méthode

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. ///
Résultat void

CloseSession() public méthode

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. ///
Résultat void

PingTo() public méthode

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. ///
Résultat bool

PingTo() public méthode

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. ///
Résultat bool

SendTo() public méthode

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. ///
Résultat void

SendTo() public méthode

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. ///
Résultat void

SendToAsync() public méthode

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. ///
Résultat void

SendToAsync() public méthode

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. ///
Résultat void

SendToAsync() public méthode

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. ///
Résultat void

TryGetServiceHost() public méthode

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. ///
Résultat bool

this() public méthode

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. ///
Résultat WebSocketSharp.Server.WebSocketServiceHost