Interface IWebSocketConnection
Provides an interface describing a connection to a WebSocket.
public interface IWebSocketConnection
Properties
ConnectionInfo
Gets an IWebSocketConnectionInfo object describing the connection.
IWebSocketConnectionInfo ConnectionInfo { get; }
Property Value
Methods
Close()
Closes the connection.
void Close()
Send(byte[])
Sends a binary message over the connection.
void Send(byte[] message)
Parameters
message
byte[]The binary message to send.
Send(string)
Sends a text message over the connection.
void Send(string message)
Parameters
message
stringThe text message to send.
SendRaw(string)
Sends raw text over the connection, without passing through a handler.
void SendRaw(string message)
Parameters
message
stringThe message to send.
Events
BinaryMessageReceived
Event raised when a binary message is received via the connection.
event EventHandler<BinaryMessageHandledEventArgs> BinaryMessageReceived
Event Type
Closed
Event raised when a connection is closed.
event EventHandler<ConnectionEventArgs> Closed
Event Type
ErrorReceived
Event raised when an error occurs via the connection.
event EventHandler<ErrorEventArgs> ErrorReceived
Event Type
MessageReceived
Event raised when a text message is received via the connection.
event EventHandler<TextMessageHandledEventArgs> MessageReceived
Event Type
Opened
Event raised when a connection is opened.
event EventHandler<ConnectionEventArgs> Opened
Event Type
Sent
Event raised when data is sent via the connection.
event EventHandler Sent
Event Type
StandardHttpRequestReceived
Event raised when a non-WebSocket message is received.
event EventHandler<StandardHttpRequestReceivedEventArgs> StandardHttpRequestReceived