API reference

IWitWebSocketClient Interface

An interface for all web socket client settings, state determinations, event callbacks, connection, disconnection and request interactions.

Properties

ConnectionState : WitWebSocketConnectionState
[Get]
Whether the web socket is disconnected, connecting, connected, or disconnecting.
Signature
WitWebSocketConnectionState Meta.Voice.Net.WebSockets.IWitWebSocketClient.ConnectionState
FailedConnectionAttempts : int
[Get]
Total amount of failed connection attempts made
Signature
int Meta.Voice.Net.WebSockets.IWitWebSocketClient.FailedConnectionAttempts
IsAuthenticated : bool
[Get]
Whether authentication had completed successfully or not
Signature
bool Meta.Voice.Net.WebSockets.IWitWebSocketClient.IsAuthenticated
IsDownloading : bool
[Get]
Whether there currently is data being received and/or decoded from the web socket.
Signature
bool Meta.Voice.Net.WebSockets.IWitWebSocketClient.IsDownloading
IsReconnecting : bool
[Get]
Whether will be reconnecting
Signature
bool Meta.Voice.Net.WebSockets.IWitWebSocketClient.IsReconnecting
IsReferenced : bool
[Get]
Whether there currently are any scripts that have called Connect() and not yet requested a Disconnect().
Signature
bool Meta.Voice.Net.WebSockets.IWitWebSocketClient.IsReferenced
IsUploading : bool
[Get]
Whether there currently is data being encoded and/or queued to be sent from the web socket.
Signature
bool Meta.Voice.Net.WebSockets.IWitWebSocketClient.IsUploading
LastResponseTime : DateTime
[Get]
The utc time of the last response from the server
Signature
DateTime Meta.Voice.Net.WebSockets.IWitWebSocketClient.LastResponseTime
ReferenceCount : int
[Get]
Total amount of scripts that have called Connect() and have not yet called Disconnect(). Used to ensure WebSocketClient is only disconnected once no scripts are still referenced.
Signature
int Meta.Voice.Net.WebSockets.IWitWebSocketClient.ReferenceCount
Requests : Dictionary< string, IWitWebSocketRequest >
[Get]
The requests currently being tracked by this client. Each access generates a new dictionary and should be cached.
Signature
Dictionary<string, IWitWebSocketRequest> Meta.Voice.Net.WebSockets.IWitWebSocketClient.Requests
[Get]
The settings required to connect, authenticate and drive server/client communication.
Signature
WitWebSocketSettings Meta.Voice.Net.WebSockets.IWitWebSocketClient.Settings

Events

OnConnectionStateChanged : Action< WitWebSocketConnectionState >
Callback on connection state change.
Signature
Action<WitWebSocketConnectionState> Meta.Voice.Net.WebSockets.IWitWebSocketClient.OnConnectionStateChanged
OnProcessForwardedResponse : WitWebSocketResponseProcessor
An event callback for processing a response for a request originating on a different client with a topic this client has subscribed to.
Signature
WitWebSocketResponseProcessor Meta.Voice.Net.WebSockets.IWitWebSocketClient.OnProcessForwardedResponse
OnTopicRequestTracked : Action< string, IWitWebSocketRequest >
Callback when a tracked topic generates a request
Signature
Action<string, IWitWebSocketRequest> Meta.Voice.Net.WebSockets.IWitWebSocketClient.OnTopicRequestTracked

Methods

Connect ()
Attempts to connect to the specified
Signature
void Meta.Voice.Net.WebSockets.IWitWebSocketClient.Connect()
Returns
void
Disconnect ()
Disconnects socket after checking state
Signature
void Meta.Voice.Net.WebSockets.IWitWebSocketClient.Disconnect()
Returns
void
SendRequest ( request )
Send a request via this client if possible
Signature
bool Meta.Voice.Net.WebSockets.IWitWebSocketClient.SendRequest(IWitWebSocketRequest request)
Parameters
Returns
bool
TrackRequest ( request )
Safely adds a request to the current request list
Signature
bool Meta.Voice.Net.WebSockets.IWitWebSocketClient.TrackRequest(IWitWebSocketRequest request)
Parameters
Returns
bool
Unsubscribe ( topicId , ignoreRefCount )
Method to subscribe to a specific topic id with a parameter to ignore ref count for local unsubscribing following disconnect/error.
Signature
void Meta.Voice.Net.WebSockets.IWitWebSocketClient.Unsubscribe(string topicId, bool ignoreRefCount)
Parameters
topicId: string
ignoreRefCount: bool
Returns
void
UntrackRequest ( request )
Safely removes a request from the current request list
Signature
bool Meta.Voice.Net.WebSockets.IWitWebSocketClient.UntrackRequest(IWitWebSocketRequest request)
Parameters
Returns
bool
UntrackRequest ( requestId )
Safely removes a request from the current request list by request id
Signature
bool Meta.Voice.Net.WebSockets.IWitWebSocketClient.UntrackRequest(string requestId)
Parameters
requestId: string
Returns
bool