Click or drag to resize

WebSocket Class

Implements the WebSocket interface.
Inheritance Hierarchy
SystemObject
  Sfs2X.WebSocketSharpWebSocket

Namespace:  Sfs2X.WebSocketSharp
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public class WebSocket : IDisposable

The WebSocket type exposes the following members.

Constructors
  NameDescription
Public methodWebSocket
Initializes a new instance of the WebSocket class with url and optionally protocols.
Top
Properties
  NameDescription
Public propertyCompression
Gets or sets the compression method used to compress a message.
Public propertyCookies
Gets the HTTP cookies included in the handshake request/response.
Public propertyCredentials
Gets the credentials for the HTTP authentication (Basic/Digest).
Public propertyEmitOnPing
Gets or sets a value indicating whether a OnMessage event is emitted when a ping is received.
Public propertyEnableRedirection
Gets or sets a value indicating whether the URL redirection for the handshake request is allowed.
Public propertyExtensions
Gets the extensions selected by server.
Public propertyIsAlive
Gets a value indicating whether the connection is alive.
Public propertyIsSecure
Gets a value indicating whether a secure connection is used.
Public propertyLog
Gets the logging function.
Public propertyOrigin
Gets or sets the value of the HTTP Origin header to send with the handshake request.
Public propertyProtocol
Gets the name of subprotocol selected by the server.
Public propertyReadyState
Gets the current state of the connection.
Public propertySslConfiguration
Gets the configuration for secure connection.
Public propertyUrl
Gets the URL to which to connect.
Public propertyWaitTime
Gets or sets the time to wait for the response to the ping or close.
Top
Methods
  NameDescription
Public methodAccept
Accepts the handshake request.
Public methodAcceptAsync
Accepts the handshake request asynchronously.
Public methodClose
Closes the connection.
Public methodClose(CloseStatusCode)
Closes the connection with the specified code.
Public methodClose(UInt16)
Closes the connection with the specified code.
Public methodClose(CloseStatusCode, String)
Closes the connection with the specified code and reason.
Public methodClose(UInt16, String)
Closes the connection with the specified code and reason.
Public methodCloseAsync
Closes the connection asynchronously.
Public methodCloseAsync(CloseStatusCode)
Closes the connection asynchronously with the specified code.
Public methodCloseAsync(UInt16)
Closes the connection asynchronously with the specified code.
Public methodCloseAsync(CloseStatusCode, String)
Closes the connection asynchronously with the specified code and reason.
Public methodCloseAsync(UInt16, String)
Closes the connection asynchronously with the specified code and reason.
Public methodConnect
Establishes a connection.
Public methodConnectAsync
Establishes a connection asynchronously.
Public methodPing
Sends a ping using the WebSocket connection.
Public methodPing(String)
Sends a ping with message using the WebSocket connection.
Public methodSend(Byte)
Sends the specified data using the WebSocket connection.
Public methodSend(FileInfo)
Sends the specified file using the WebSocket connection.
Public methodSend(String)
Sends the specified data using the WebSocket connection.
Public methodSend(Stream, Int32)
Sends the data from the specified stream using the WebSocket connection.
Public methodSendAsync(Byte, ActionBoolean)
Sends the specified data asynchronously using the WebSocket connection.
Public methodSendAsync(FileInfo, ActionBoolean)
Sends the specified file asynchronously using the WebSocket connection.
Public methodSendAsync(String, ActionBoolean)
Sends the specified data asynchronously using the WebSocket connection.
Public methodSendAsync(Stream, Int32, ActionBoolean)
Sends the data from the specified stream asynchronously using the WebSocket connection.
Public methodSetCookie
Sets an HTTP cookie to send with the handshake request.
Public methodSetCredentials
Sets the credentials for the HTTP authentication (Basic/Digest).
Public methodSetProxy
Sets the URL of the HTTP proxy server through which to connect and the credentials for the HTTP proxy authentication (Basic/Digest).
Top
Events
  NameDescription
Public eventOnClose
Occurs when the WebSocket connection has been closed.
Public eventOnError
Occurs when the WebSocket gets an error.
Public eventOnMessage
Occurs when the WebSocket receives a message.
Public eventOnOpen
Occurs when the WebSocket connection has been established.
Top
Remarks

This class provides a set of methods and properties for two-way communication using the WebSocket protocol.

The WebSocket protocol is defined in RFC 6455.

See Also