Skip to main content
Version: 3.1.0

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
TypeName
System.Uriuri

Close()

View Source
Declaration
public void Close()

Close(WebSocketCloseStatus)

View Source
Declaration
public void Close(WebSocketCloseStatus status)
Parameters
TypeName
System.Net.WebSockets.WebSocketCloseStatusstatus

ToData(byte[], BufferType)

View Source
Declaration
public void ToData(byte[] buffer, BufferType bufferType = BufferType.Binary)
Parameters
TypeName
System.Byte[]buffer
Netly.Core.BufferTypebufferType

ToData(string, BufferType)

View Source
Declaration
public void ToData(string buffer, BufferType bufferType = BufferType.Text)
Parameters
TypeName
System.Stringbuffer
Netly.Core.BufferTypebufferType

ToEvent(string, byte[])

View Source
Declaration
public void ToEvent(string name, byte[] buffer)
Parameters
TypeName
System.Stringname
System.Byte[]buffer

ToEvent(string, string)

View Source
Declaration
public void ToEvent(string name, string buffer)
Parameters
TypeName
System.Stringname
System.Stringbuffer

OnOpen(Action)

View Source
Declaration
public void OnOpen(Action callback)
Parameters
TypeName
System.Actioncallback

OnClose(Action<WebSocketCloseStatus>)

View Source
Declaration
public void OnClose(Action<WebSocketCloseStatus> callback)
Parameters
TypeName
System.Action<System.Net.WebSockets.WebSocketCloseStatus>callback

OnClose(Action)

View Source
Declaration
public void OnClose(Action callback)
Parameters
TypeName
System.Actioncallback

OnError(Action<Exception>)

View Source
Declaration
public void OnError(Action<Exception> callback)
Parameters
TypeName
System.Action<System.Exception>callback

OnData(Action<byte[], BufferType>)

View Source
Declaration
public void OnData(Action<byte[], BufferType> callback)
Parameters
TypeName
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
TypeName
System.Action<System.String,System.Byte[],Netly.Core.BufferType>callback

OnModify(Action<ClientWebSocket>)

View Source
Declaration
public void OnModify(Action<ClientWebSocket> callback)
Parameters
TypeName
System.Action<System.Net.WebSockets.ClientWebSocket>callback