C-DEngine 5.105

WebSocket Members

The WebSocket type exposes the following members.

Constructors


  Name Description
Public method WebSocket(String, array<String>[]()[][])
Initializes a new instance of the WebSocket class with the specified WebSocket URL and subprotocols.

Methods


  Name Description
Public method Accept
Accepts the WebSocket connection request.
Public method AcceptAsync
Accepts the WebSocket connection request asynchronously.
Public method Close()()()()
Closes the WebSocket connection, and releases all associated resources.
Public method Close(UInt16)
Closes the WebSocket connection with the specified UInt16, and releases all associated resources.
Public method Close(CloseStatusCode)
Closes the WebSocket connection with the specified CloseStatusCode, and releases all associated resources.
Public method Close(UInt16, String)
Closes the WebSocket connection with the specified UInt16 and String, and releases all associated resources.
Public method Close(CloseStatusCode, String)
Closes the WebSocket connection with the specified CloseStatusCode and String, and releases all associated resources.
Public method CloseAsync()()()()
Closes the WebSocket connection asynchronously, and releases all associated resources.
Public method CloseAsync(UInt16)
Closes the WebSocket connection asynchronously with the specified UInt16, and releases all associated resources.
Public method CloseAsync(CloseStatusCode)
Closes the WebSocket connection asynchronously with the specified CloseStatusCode, and releases all associated resources.
Public method CloseAsync(UInt16, String)
Closes the WebSocket connection asynchronously with the specified UInt16 and String, and releases all associated resources.
Public method CloseAsync(CloseStatusCode, String)
Closes the WebSocket connection asynchronously with the specified CloseStatusCode and String, and releases all associated resources.
Public method Connect
Establishes a WebSocket connection.
Public method ConnectAsync
Establishes a WebSocket connection asynchronously.
Public method Equals(System.Object) (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method Ping()()()()
Sends a ping using the WebSocket connection.
Public method Ping(String)
Sends a ping with the specified message using the WebSocket connection.
Public method Send(array<Byte>[]()[][])
Sends binary data using the WebSocket connection.
Public method Send(FileInfo)
Sends the specified file as binary data using the WebSocket connection.
Public method Send(String)
Sends text data using the WebSocket connection.
Public method SendAsync(array<Byte>[]()[][], Action<(Of <<'(Boolean>)>>))
Sends binary data asynchronously using the WebSocket connection.
Public method SendAsync(FileInfo, Action<(Of <<'(Boolean>)>>))
Sends the specified file as binary data asynchronously using the WebSocket connection.
Public method SendAsync(String, Action<(Of <<'(Boolean>)>>))
Sends text data asynchronously using the WebSocket connection.
Public method SendAsync(Stream, Int32, Action<(Of <<'(Boolean>)>>))
Sends binary data from the specified Stream asynchronously using the WebSocket connection.
Public method SetCookie
Sets an HTTP cookie to send with the WebSocket connection request to the server.
Public method SetCredentials
Sets a pair of username and password for the HTTP authentication (Basic/Digest).
Public method SetProxy
Sets an HTTP proxy server URL to connect through, and if necessary, a pair of username and password for the proxy server authentication (Basic/Digest).
Public method ToString (Inherited from Object.)

Properties


  Name Description
Public property Compression
Gets or sets the compression method used to compress a message on the WebSocket connection.
Public property Cookies
Gets the HTTP cookies included in the WebSocket connection request and response.
Public property Credentials
Gets the credentials for the HTTP authentication (Basic/Digest).
Public property EmitOnPing
Gets or sets a value indicating whether the WebSocket emits a OnMessage event when receives a ping.
Public property EnableRedirection
Gets or sets a value indicating whether the WebSocket redirects the connection request to the new URL located in the connection response.
Public property Extensions
Gets the WebSocket extensions selected by the server.
Public property IsAlive
Gets a value indicating whether the WebSocket connection is alive.
Public property IsSecure
Gets a value indicating whether the WebSocket connection is secure.
Public property Log
Gets the logging functions.
Public property Origin
Gets or sets the value of the HTTP Origin header to send with the WebSocket connection request to the server.
Public property Protocol
Gets the WebSocket subprotocol selected by the server.
Public property ReadyState
Gets the state of the WebSocket connection.
Public property SslConfiguration
Gets or sets the SSL configuration used to authenticate the server and optionally the client for secure connection.
Public property Url
Gets the WebSocket URL used to connect, or accepted.
Public property WaitTime
Gets or sets the wait time for the response to the Ping or Close.

Events


  Name Description
Public event OnClose
Occurs when the WebSocket connection has been closed.
Public event OnError
Occurs when the WebSocket gets an error.
Public event OnMessage
Occurs when the WebSocket receives a message.
Public event OnOpen
Occurs when the WebSocket connection has been established.