WitWebSocketClient
(
settings
)
|
Constructor with settings data
Signature
Meta.Voice.Net.WebSockets.WitWebSocketClient.WitWebSocketClient(WitWebSocketSettings settings) Parameters settings: WitWebSocketSettings |
WitWebSocketClient
(
configuration
)
|
Constructor that takes in IWitRequestConfiguration and generates default settings use it
Signature
Meta.Voice.Net.WebSockets.WitWebSocketClient.WitWebSocketClient(IWitRequestConfiguration configuration) Parameters configuration: IWitRequestConfiguration |
ConnectionRequestId
: string |
The unique id associated with this connection request
Signature
string Meta.Voice.Net.WebSockets.WitWebSocketClient.ConnectionRequestId |
IsDownloading
: bool |
Whether there currently is data being received and/or decoded from the web socket.
Signature
bool Meta.Voice.Net.WebSockets.WitWebSocketClient.IsDownloading |
IsReconnecting
: bool |
Whether will be reconnecting
Signature
bool Meta.Voice.Net.WebSockets.WitWebSocketClient.IsReconnecting |
IsReferenced
: bool |
Whether there currently are any scripts that have called Connect() and not yet requested a Disconnect().
Signature
bool Meta.Voice.Net.WebSockets.WitWebSocketClient.IsReferenced |
IsUploading
: bool |
Whether there currently is data being encoded and/or queued to be sent from the web socket.
Signature
bool Meta.Voice.Net.WebSockets.WitWebSocketClient.IsUploading |
The options associated with this connection request
Signature
Meta.WitAi.Configuration.WitRequestOptions Meta.Voice.Net.WebSockets.WitWebSocketClient.Options | |
Requests
: Dictionary< string, IWitWebSocketRequest > |
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.WitWebSocketClient.Requests |
ConnectionCompletion
: TaskCompletionSource< bool >
[Get] |
A task that will complete once the connection process completes. Response will be true if connected successfully and false otherwise.
Signature
TaskCompletionSource<bool> Meta.Voice.Net.WebSockets.WitWebSocketClient.ConnectionCompletion |
ConnectionState
: WitWebSocketConnectionState
[Get] |
Whether the web socket is disconnected, connecting, connected, or disconnecting.
Signature
WitWebSocketConnectionState Meta.Voice.Net.WebSockets.WitWebSocketClient.ConnectionState |
FailedConnectionAttempts
: int
[Get] |
Total amount of failed connection attempts made
Signature
int Meta.Voice.Net.WebSockets.WitWebSocketClient.FailedConnectionAttempts |
IsAuthenticated
: bool
[Get] |
Whether authentication had completed successfully or not
Signature
bool Meta.Voice.Net.WebSockets.WitWebSocketClient.IsAuthenticated |
LastResponseTime
: DateTime
[Get] |
The utc time of the last response from the server
Signature
DateTime Meta.Voice.Net.WebSockets.WitWebSocketClient.LastResponseTime |
Logger
: IVLogger
[Get] |
Signature
IVLogger Meta.Voice.Net.WebSockets.WitWebSocketClient.Logger |
OnError
: WitErrorEvent
[Get] |
Triggered when there was an error in setup or with websocket communications
Signature
WitErrorEvent Meta.Voice.Net.WebSockets.WitWebSocketClient.OnError |
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.WitWebSocketClient.ReferenceCount |
Settings
: WitWebSocketSettings
[Get] |
The settings required to connect, authenticate and drive server/client communication.
Signature
WitWebSocketSettings Meta.Voice.Net.WebSockets.WitWebSocketClient.Settings |
OnConnectionStateChanged
: Action< WitWebSocketConnectionState > |
Callback on connection state change.
Signature
Action<WitWebSocketConnectionState> Meta.Voice.Net.WebSockets.WitWebSocketClient.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.WitWebSocketClient.OnProcessForwardedResponse |
OnRequestTracked
: Action< WitWebSocketClient, IWitWebSocketRequest > |
An event that is called whenever a request begins being tracked by a WitWebSocketClient
Signature
Action<WitWebSocketClient, IWitWebSocketRequest> Meta.Voice.Net.WebSockets.WitWebSocketClient.OnRequestTracked |
OnRequestUntracked
: Action< WitWebSocketClient, IWitWebSocketRequest > |
An event that is called whenever a request stops being tracked by a WitWebSocketClient
Signature
Action<WitWebSocketClient, IWitWebSocketRequest> Meta.Voice.Net.WebSockets.WitWebSocketClient.OnRequestUntracked |
OnTopicRequestTracked
: Action< string, IWitWebSocketRequest > |
Callback when a tracked topic generates a request
Signature
Action<string, IWitWebSocketRequest> Meta.Voice.Net.WebSockets.WitWebSocketClient.OnTopicRequestTracked |
OnTopicSubscriptionStateChange
: PubSubTopicSubscriptionDelegate |
Callback when subscription state changes for a specific topic id
Signature
PubSubTopicSubscriptionDelegate Meta.Voice.Net.WebSockets.WitWebSocketClient.OnTopicSubscriptionStateChange |
Connect
()
|
Attempts to connect to the specified
Signature
void Meta.Voice.Net.WebSockets.WitWebSocketClient.Connect() Returns void |
Disconnect
()
|
Disconnects socket after checking state
Signature
void Meta.Voice.Net.WebSockets.WitWebSocketClient.Disconnect() Returns void |
Dispose
()
|
Remove all references
Signature
void Meta.Voice.Net.WebSockets.WitWebSocketClient.Dispose() Returns void |
ForceDisconnect
()
|
Forces a disconnect independent from reference count. to reconnect.
Signature
void Meta.Voice.Net.WebSockets.WitWebSocketClient.ForceDisconnect() Returns void |
GetTopicSubscriptionState
(
topicId
)
|
Obtains the current subscription state for a specific topic
Signature
PubSubSubscriptionState Meta.Voice.Net.WebSockets.WitWebSocketClient.GetTopicSubscriptionState(string topicId) Parameters topicId: stringReturns PubSubSubscriptionState |
SendRequest
(
request
)
|
Send a request via this client if possible
Signature
bool Meta.Voice.Net.WebSockets.WitWebSocketClient.SendRequest(IWitWebSocketRequest request) Parameters request: IWitWebSocketRequestReturns bool |
SendRequestAsync
(
request
)
|
Send a request via this client if possible
Signature
async Task<string> Meta.Voice.Net.WebSockets.WitWebSocketClient.SendRequestAsync(IWitWebSocketRequest request) Parameters request: IWitWebSocketRequestReturns async Task< string > |
Subscribe
(
topicId
)
|
Method to subscribe to a specific topic id
Signature
void Meta.Voice.Net.WebSockets.WitWebSocketClient.Subscribe(string topicId) Parameters topicId: stringReturns void |
TrackRequest
(
request
)
|
Safely adds a request to the current request list
Signature
bool Meta.Voice.Net.WebSockets.WitWebSocketClient.TrackRequest(IWitWebSocketRequest request) Parameters request: IWitWebSocketRequestReturns bool |
Unsubscribe
(
topicId
)
|
Method to unsubscribe to a specific topic id
Signature
void Meta.Voice.Net.WebSockets.WitWebSocketClient.Unsubscribe(string topicId) Parameters topicId: stringReturns void |
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.WitWebSocketClient.Unsubscribe(string topicId, bool ignoreRefCount) Parameters topicId: stringignoreRefCount: boolReturns void |
UntrackRequest
(
request
)
|
Safely removes a request from the current request list
Signature
bool Meta.Voice.Net.WebSockets.WitWebSocketClient.UntrackRequest(IWitWebSocketRequest request) Parameters request: IWitWebSocketRequestReturns bool |
UntrackRequest
(
requestId
)
|
Safely removes a request from the current request list by request id
Signature
bool Meta.Voice.Net.WebSockets.WitWebSocketClient.UntrackRequest(string requestId) Parameters requestId: stringReturns bool |