Exemple #1
0
        public RpcError abortCall(uint exceptionCode)
        {
            if (AsyncContextStatus.InProgress != status)
            {
                throw new InvalidOperationException(String.Format("Invalid operation, the current state = {0}.", status));
            }
            RpcError result = RpcApi.RpcAsyncAbortCall(asyncState, exceptionCode);

            status = AsyncContextStatus.Aborted;
            return(result);
        }
Exemple #2
0
        public RpcError completeCall(byte[] value, uint exceptionCode)
        {
            if (AsyncContextStatus.InProgress != status)
            {
                throw new InvalidOperationException(String.Format("Invalid operation, the current state = {0}.", status));
            }

            if (null != value)
            {
                // write output payload
                putOutput(value);
            }

            var      rt     = (IntPtr)exceptionCode;
            RpcError result = RpcApi.RpcAsyncCompleteCall(asyncState, ref rt);

            status = AsyncContextStatus.Completed;
            return(result);
        }