websocket-sharp : WebSocketSharp.Server Namespace

WebSocketService Class

Provides the basic functions of the WebSocket service.

Syntax

public abstract class WebSocketService

Remarks

The WebSocketService class is an abstract class.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Members

See Also: Inherited members from object.

Public Constructors

Initializes a new instance of the WebSocketSharp.Server.WebSocketService class.

Public Properties

[read-only]
ID string . Gets the ID of a WebSocketSharp.Server.WebSocketService instance.
[read-only]
IsBound bool . Gets a value indicating whether a WebSocketSharp.Server.WebSocketService instance is bound to a WebSocketSharp.WebSocket.

Protected Properties

[read-only]
QueryString System.Collections.Specialized.NameValueCollection . Gets the HTTP query string variables used in the WebSocket opening handshake.
[read-only]
Sessions SessionManager . Gets the sessions to the WebSocket service.

Public Methods

Bind (WebSocketSharp.WebSocket, SessionManager)
Binds the specified WebSocketSharp.WebSocket and WebSocketSharp.Server.SessionManager to a WebSocketSharp.Server.WebSocketService instance.
Broadcast (byte[])
Broadcasts the specified array of byte to all clients of the WebSocket service.
Broadcast (string)
Broadcasts the specified string to all clients of the WebSocket service.
Broadping () : Dictionary<string, bool>
Pings to all clients of the WebSocket service.
Broadping (string) : Dictionary<string, bool>
Pings with the specified string to all clients of the WebSocket service.
Ping () : bool
Pings to the client of a WebSocketSharp.Server.WebSocketService instance.
Ping (string) : bool
Pings with the specified string to the client of a WebSocketSharp.Server.WebSocketService instance.
PingTo (string) : bool
Pings to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID.
PingTo (string, string) : bool
Pings with the specified string to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID.
Send (byte[])
Sends a binary data to the client of a WebSocketSharp.Server.WebSocketService instance.
Send (string)
Sends a text data to the client of a WebSocketSharp.Server.WebSocketService instance.
SendTo (string, byte[])
Sends a binary data to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID.
SendTo (string, string)
Sends a text data to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID.
Start ()
Starts a WebSocketSharp.Server.WebSocketService instance.
Stop ()
Stops a WebSocketSharp.Server.WebSocketService instance.
Stop (ushort, string)
Stops a WebSocketSharp.Server.WebSocketService instance with the specified ushort and string.
Stop (WebSocketSharp.CloseStatusCode, string)
Stops a WebSocketSharp.Server.WebSocketService instance with the specified WebSocketSharp.CloseStatusCode and string.

Protected Methods

OnClose (WebSocketSharp.CloseEventArgs)
Occurs when a inner WebSocketSharp.WebSocket receives a Close frame or the Stop method is called.
OnError (WebSocketSharp.ErrorEventArgs)
Occurs when a inner WebSocketSharp.WebSocket gets an error.
OnMessage (WebSocketSharp.MessageEventArgs)
Occurs when a inner WebSocketSharp.WebSocket receives a data frame.
OnOpen ()
Occurs when the WebSocket connection has been established.

Extension Methods

static
IsNull<T> (this T) : bool
Determines whether the specified object is null.
static
IsNullDo<T> (this T, Action) : bool
Determines whether the specified object is null. And invokes the specified Action delegate if the specified object is null.

Member Details

WebSocketService Constructor

Initializes a new instance of the WebSocketSharp.Server.WebSocketService class.

Syntax

public WebSocketService ()

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Bind Method

Binds the specified WebSocketSharp.WebSocket and WebSocketSharp.Server.SessionManager to a WebSocketSharp.Server.WebSocketService instance.

Syntax

public void Bind (WebSocketSharp.WebSocket socket, SessionManager sessions)

Parameters

socket
A WebSocketSharp.WebSocket to bind to the WebSocketService.
sessions
A WebSocketSharp.Server.SessionManager to bind to the WebSocketService.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Broadcast Method

Broadcasts the specified array of byte to all clients of the WebSocket service.

Syntax

public void Broadcast (byte[] data)

Parameters

data
An array of byte to broadcast.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Broadcast Method

Broadcasts the specified string to all clients of the WebSocket service.

Syntax

public void Broadcast (string data)

Parameters

data
A string to broadcast.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Broadping Method

Pings to all clients of the WebSocket service.

Syntax

public Dictionary<string, bool> Broadping ()

Returns

A Dictionary<string, bool> that contains the collection of the ID and value indicating whether the WebSocket service received a Pong in a time.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Broadping Method

Pings with the specified string to all clients of the WebSocket service.

Syntax

public Dictionary<string, bool> Broadping (string message)

Parameters

message
A string that contains a message.

Returns

A Dictionary<string, bool> that contains the collection of the ID and value indicating whether the WebSocket service received a Pong in a time.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

ID Property

Gets the ID of a WebSocketSharp.Server.WebSocketService instance.

Syntax

public string ID { get; }

Value

A string that contains a ID.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

IsBound Property

Gets a value indicating whether a WebSocketSharp.Server.WebSocketService instance is bound to a WebSocketSharp.WebSocket.

Syntax

public bool IsBound { get; }

Value

true if the WebSocketService is bound to a WebSocket; otherwise, false.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

OnClose Method

Occurs when a inner WebSocketSharp.WebSocket receives a Close frame or the Stop method is called.

Syntax

protected virtual void OnClose (WebSocketSharp.CloseEventArgs e)

Parameters

e
A WebSocketSharp.CloseEventArgs that contains the event data associated with a WebSocketSharp.WebSocket.OnClose event.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

OnError Method

Occurs when a inner WebSocketSharp.WebSocket gets an error.

Syntax

protected virtual void OnError (WebSocketSharp.ErrorEventArgs e)

Parameters

e
An WebSocketSharp.ErrorEventArgs that contains the event data associated with a WebSocketSharp.WebSocket.OnError event.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

OnMessage Method

Occurs when a inner WebSocketSharp.WebSocket receives a data frame.

Syntax

protected virtual void OnMessage (WebSocketSharp.MessageEventArgs e)

Parameters

e
A WebSocketSharp.MessageEventArgs that contains the event data associated with a WebSocketSharp.WebSocket.OnMessage event.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

OnOpen Method

Occurs when the WebSocket connection has been established.

Syntax

protected virtual void OnOpen ()

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Ping Method

Pings to the client of a WebSocketSharp.Server.WebSocketService instance.

Syntax

public bool Ping ()

Returns

true if the WebSocketService receives a Pong in a time; otherwise, false.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Ping Method

Pings with the specified string to the client of a WebSocketSharp.Server.WebSocketService instance.

Syntax

public bool Ping (string message)

Parameters

message
A string that contains a message.

Returns

true if the WebSocketService receives a Pong in a time; otherwise, false.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

PingTo Method

Pings to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID.

Syntax

public bool PingTo (string id)

Parameters

id
A string that contains a ID that represents the destination for the Ping.

Returns

true if the WebSocket service receives a Pong in a time; otherwise, false.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

PingTo Method

Pings with the specified string to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID.

Syntax

public bool PingTo (string id, string message)

Parameters

id
A string that contains a ID that represents the destination for the Ping.
message
A string that contains a message.

Returns

true if the WebSocketService receives a Pong in a time; otherwise, false.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

QueryString Property

Gets the HTTP query string variables used in the WebSocket opening handshake.

Syntax

Value

A System.Collections.Specialized.NameValueCollection that contains the query string variables.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Send Method

Sends a binary data to the client of a WebSocketSharp.Server.WebSocketService instance.

Syntax

public void Send (byte[] data)

Parameters

data
An array of byte that contains a binary data to send.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Send Method

Sends a text data to the client of a WebSocketSharp.Server.WebSocketService instance.

Syntax

public void Send (string data)

Parameters

data
A string that contains a text data to send.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

SendTo Method

Sends a binary data to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID.

Syntax

public void SendTo (string id, byte[] data)

Parameters

id
A string that contains a ID that represents the destination for the data.
data
An array of byte that contains a binary data to send.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

SendTo Method

Sends a text data to the client of a WebSocketSharp.Server.WebSocketService instance associated with the specified ID.

Syntax

public void SendTo (string id, string data)

Parameters

id
A string that contains a ID that represents the destination for the data.
data
A string that contains a text data to send.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Sessions Property

Gets the sessions to the WebSocket service.

Syntax

protected SessionManager Sessions { get; }

Value

A WebSocketSharp.Server.SessionManager that contains the sessions to the WebSocket service.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Start Method

Starts a WebSocketSharp.Server.WebSocketService instance.

Syntax

public void Start ()

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Stop Method

Stops a WebSocketSharp.Server.WebSocketService instance.

Syntax

public void Stop ()

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Stop Method

Stops a WebSocketSharp.Server.WebSocketService instance with the specified ushort and string.

Syntax

public void Stop (ushort code, string reason)

Parameters

code
A ushort that contains a status code indicating the reason for stop.
reason
A string that contains a reason for stop.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)

Stop Method

Stops a WebSocketSharp.Server.WebSocketService instance with the specified WebSocketSharp.CloseStatusCode and string.

Syntax

public void Stop (WebSocketSharp.CloseStatusCode code, string reason)

Parameters

code
One of the WebSocketSharp.CloseStatusCode values that contains a status code indicating the reason for stop.
reason
A string that contains a reason for stop.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp.Server
Assembly: websocket-sharp (in websocket-sharp.dll)