Class WebSocketClient
Assembly: Netly.dll
View Source
Declaration
public class WebSocketClient
Properties
IsOpened
View Source
Declaration
public bool IsOpened { get; }
Uri
View Source
Declaration
public Uri Uri { get; }
Headers
View Source
Declaration
public KeyValueContainer Headers { get; }
Cookies
View Source
Declaration
public Cookie[] Cookies { get; }
Methods
Open(Uri)
View Source
Declaration
public void Open(Uri uri)
Parameters
| Type | Name |
|---|---|
System.Uri | uri |
Close()
View Source
Declaration
public void Close()
Close(WebSocketCloseStatus)
View Source
Declaration
public void Close(WebSocketCloseStatus status)
Parameters
| Type | Name |
|---|---|
System.Net.WebSockets.WebSocketCloseStatus | status |
ToData(byte[], BufferType)
View Source
Declaration
public void ToData(byte[] buffer, BufferType bufferType = BufferType.Binary)
Parameters
| Type | Name |
|---|---|
System.Byte[] | buffer |
| Netly.Core.BufferType | bufferType |
ToData(string, BufferType)
View Source
Declaration
public void ToData(string buffer, BufferType bufferType = BufferType.Text)
Parameters
| Type | Name |
|---|---|
System.String | buffer |
| Netly.Core.BufferType | bufferType |
ToEvent(string, byte[])
View Source
Declaration
public void ToEvent(string name, byte[] buffer)
Parameters
| Type | Name |
|---|---|
System.String | name |
System.Byte[] | buffer |
ToEvent(string, string)
View Source
Declaration
public void ToEvent(string name, string buffer)
Parameters
| Type | Name |
|---|---|
System.String | name |
System.String | buffer |
OnOpen(Action)
View Source
Declaration
public void OnOpen(Action callback)
Parameters
| Type | Name |
|---|---|
System.Action | callback |
OnClose(Action<WebSocketCloseStatus>)
View Source
Declaration
public void OnClose(Action<WebSocketCloseStatus> callback)
Parameters
| Type | Name |
|---|---|
System.Action<System.Net.WebSockets.WebSocketCloseStatus> | callback |
OnClose(Action)
View Source
Declaration
public void OnClose(Action callback)
Parameters
| Type | Name |
|---|---|
System.Action | callback |
OnError(Action<Exception>)
View Source
Declaration
public void OnError(Action<Exception> callback)
Parameters
| Type | Name |
|---|---|
System.Action<System.Exception> | callback |
OnData(Action<byte[], BufferType>)
View Source
Declaration
public void OnData(Action<byte[], BufferType> callback)
Parameters
| Type | Name |
|---|---|
System.Action<System.Byte[],Netly.Core.BufferType> | callback |
OnEvent(Action<string, byte[], BufferType>)
View Source
Declaration
public void OnEvent(Action<string, byte[], BufferType> callback)
Parameters
| Type | Name |
|---|---|
System.Action<System.String,System.Byte[],Netly.Core.BufferType> | callback |
OnModify(Action<ClientWebSocket>)
View Source
Declaration
public void OnModify(Action<ClientWebSocket> callback)
Parameters
| Type | Name |
|---|---|
System.Action<System.Net.WebSockets.ClientWebSocket> | callback |