API reference
API reference
Select your platform
No SDKs available
No versions available

NativeWebSocketWrapper Class

An wrapper for NativeWebSocket to ensure it implements
Meta::Voice::Net::WebSockets::NativeWebSocketWrapper extends Meta.Voice.Net.WebSockets.IWebSocket.

Overview

Properties

State[Get]
The current state of the web socket client

Events

Action
OnOpen ( )
Callback when web socket is opened
Action< byte[]>
Callback when message is received from web socket server
Action< string >
OnError ( )
Callback when an error is received from web socket server
OnClose ( )
Callback when message is received from web socket server

Public Member Functions

NativeWebSocketWrapper
( string url,
Dictionary< string, string > headers )
Constructor that takes in url and headers and adds all callbacks.
async Task
Connect ( )
Method to begin web socket communication
async Task
Send
( byte [] data )
Method to send byte data to a web socket
async Task
Close ( )
Method to close web socket communication with normal close code

Details

Properties

WitWebSocketConnectionState Meta.Voice.Net.WebSockets.NativeWebSocketWrapper.State
The current state of the web socket client

Events

Action Meta.Voice.Net.WebSockets.NativeWebSocketWrapper.OnOpen ( )
Callback when web socket is opened
Action<byte[]> Meta.Voice.Net.WebSockets.NativeWebSocketWrapper.OnMessage ( )
Callback when message is received from web socket server
Action<string> Meta.Voice.Net.WebSockets.NativeWebSocketWrapper.OnError ( )
Callback when an error is received from web socket server
Action<WebSocketCloseCode> Meta.Voice.Net.WebSockets.NativeWebSocketWrapper.OnClose ( )
Callback when message is received from web socket server

Member Functions

Meta.Voice.Net.WebSockets.NativeWebSocketWrapper.NativeWebSocketWrapper
( string url,
Dictionary< string, string > headers )
Constructor that takes in url and headers and adds all callbacks.
Parameters
urlheaders
async Task Meta.Voice.Net.WebSockets.NativeWebSocketWrapper.Connect ( )
Method to begin web socket communication
async Task Meta.Voice.Net.WebSockets.NativeWebSocketWrapper.Send
( byte [] data )
Method to send byte data to a web socket
async Task Meta.Voice.Net.WebSockets.NativeWebSocketWrapper.Close ( )
Method to close web socket communication with normal close code
Did you find this page helpful?
Thumbs up icon
Thumbs down icon