Ejemplo n.º 1
0
        public IAsyncResult BeginIssueRequest(vx_req_base_t request, AsyncCallback callback)
        {
            if (request == null)
            {
                throw new ArgumentNullException();
            }
            if (!Started)
            {
                throw new InvalidOperationException();
            }
            string requestId = $"{_nextRequestId++}";

            request.cookie = requestId;
            var result = new AsyncResult <vx_resp_base_t>(callback)
            {
                AsyncState = requestId
            };

            lock (_pendingRequests)
            {
                _pendingRequests[requestId] = result;
            }
            var status = VivoxCoreInstance.IssueRequest(request);

            if (status != 0)
            {
                lock (_pendingRequests)
                {
                    _pendingRequests.Remove(requestId);
                }
                throw new VivoxApiException(status);
            }
            return(result);
        }
Ejemplo n.º 2
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(vx_req_base_t obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }