string | RequestId[Get] Unique request id generated on init |
string | TopicId[Get] The specific topic id that is being published to or received via subscription, if applicable. |
int | TimeoutMs[Get] The timeout in milliseconds from the initial upload to the response from the server. If no response in time, the request will fail. |
bool | IsUploading[Get] Whether or not uploading has begun |
bool | IsDownloading[Get] Whether or not downloading has begun |
bool | IsComplete[Get] Whether or not complete |
string | Code[Get] A response code if applicable |
string | Error[Get] An error if applicable |
PostData[Get] Initial json data to be uploaded | |
ResponseData[Get] First decoded json response received | |
Action< string > | OnRawResponse[Get] Callback method when raw json response is received |
Action< IWitWebSocketRequest > | OnFirstResponse[Get] Callback when request receives the first chunk of data from the server |
Action< IWitWebSocketRequest > | OnComplete[Get] Callback when the request has completed due to a cancellation, error or success |
_uploader[Get] The method used to upload chunks | |
DateTime | _timeoutStart[Get] Start of the timeout |
Constructor which accepts a WitResponseNode as post data and applies request id | |
void | HandleUpload ( UploadChunkDelegate uploadChunk ) Called once from the main thread to begin the upload process. Sends a single post chunk. |
void | Cancel ( ) Cancel current request |
void | Called one or more times from the background thread when a chunk has returned. Stores the json data from the first response. |
override string | ToString ( ) Override ToString for more request specific info |
void | BeginTimeout ( ) Generates a task to watch for timeout |
void | SendAbort ( string reason ) Method to perform an abort call |
void | ReturnRawResponse ( string jsonString ) If raw response callback is implemented, calls on main thread |
void | SetResponseData ( WitResponseNode newResponseData ) Apply response data |
void | Method called for first response handling to mark download begin and perform first response callback on main thread. |
void | Method called on main thread when first response callback should occur |
void | HandleComplete ( ) Resets the state of the request and marks request as complete. |
void | RaiseComplete ( ) Method called on main thread when first response callback should occur |
string Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.RequestId |
---|
Unique request id generated on init |
string Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.TopicId |
---|
The specific topic id that is being published to or received via subscription, if applicable. |
int Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.TimeoutMs |
---|
The timeout in milliseconds from the initial upload to the response from the server. If no response in time, the request will fail. |
bool Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.IsUploading |
---|
Whether or not uploading has begun |
bool Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.IsDownloading |
---|
Whether or not downloading has begun |
bool Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.IsComplete |
---|
Whether or not complete |
string Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.Code |
---|
A response code if applicable |
string Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.Error |
---|
An error if applicable |
WitResponseNode Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.PostData |
---|
Initial json data to be uploaded |
WitResponseNode Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.ResponseData |
---|
First decoded json response received |
Action<string> Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.OnRawResponse |
---|
Callback method when raw json response is received |
Action<IWitWebSocketRequest> Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.OnFirstResponse |
---|
Callback when request receives the first chunk of data from the server |
Action<IWitWebSocketRequest> Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.OnComplete |
---|
Callback when the request has completed due to a cancellation, error or success |
UploadChunkDelegate Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest._uploader |
---|
The method used to upload chunks |
DateTime Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest._timeoutStart |
---|
Start of the timeout |
Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.WitWebSocketJsonRequest ( WitResponseNode postData, string requestId ) |
---|
Constructor which accepts a WitResponseNode as post data and applies request id |
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.HandleUpload ( UploadChunkDelegate uploadChunk ) |
---|
Called once from the main thread to begin the upload process. Sends a single post chunk. Parameters uploadChunk The method to be called as each json and/or binary chunk is ready to be uploaded |
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.Cancel ( ) |
---|
Cancel current request |
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.HandleDownload ( string jsonString, WitResponseNode jsonData, byte [] binaryData ) |
---|
Called one or more times from the background thread when a chunk has returned. Stores the json data from the first response. Parameters jsonString Raw json string. jsonDataDecoded json data object. binaryDataDecoded binary data chunk which may be null or empty. |
override string Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.ToString ( ) |
---|
Override ToString for more request specific info |
void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.BeginTimeout ( ) |
---|
Generates a task to watch for timeout |
void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.SendAbort ( string reason ) |
---|
Method to perform an abort call |
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.ReturnRawResponse ( string jsonString ) |
---|
If raw response callback is implemented, calls on main thread |
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.SetResponseData ( WitResponseNode newResponseData ) |
---|
Apply response data Parameters newResponseData New response data received |
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.HandleDownloadBegin ( ) |
---|
Method called for first response handling to mark download begin and perform first response callback on main thread. |
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.RaiseFirstResponse ( ) |
---|
Method called on main thread when first response callback should occur |
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.HandleComplete ( ) |
---|
Resets the state of the request and marks request as complete. |
virtual void Meta.Voice.Net.WebSockets.Requests.WitWebSocketJsonRequest.RaiseComplete ( ) |
---|
Method called on main thread when first response callback should occur |