コード例 #1
0
 private void UnpackCallData()
 {
     this.callResult  = MarshalingUtils.GetUInt64FromBigEndianBytes(this.callData, 0);
     this.ReturnValue = MarshalingUtils.GetUInt64FromBigEndianBytes(this.callData, MarshalingUtils.SizeOf(typeof(ulong)));
     if (this.Options.PostMethodCall != XDRPCPostMethodCall.None)
     {
         this.PostMethodCallReturnValue = MarshalingUtils.GetUInt64FromBigEndianBytes(this.callData, 2 * MarshalingUtils.SizeOf(typeof(ulong)));
     }
     for (int index1 = 0; index1 < this.IntegerArguments.Length; ++index1)
     {
         int index2 = index1 + 2;
         if (this.bufferData[index2].BufferSize > 0)
         {
             byte[] data = new byte[this.bufferData[index2].BufferSize];
             Array.Copy((Array)this.callData, this.bufferData[index2].BufferOffset, (Array)data, 0, data.Length);
             this.IntegerArguments[index1].UnpackBufferData(data);
         }
     }
     for (int index = 0; index < this.IntegerArguments.Length; ++index)
     {
         if (this.referenceData[index].BufferSize > 0)
         {
             byte[] data = new byte[this.referenceData[index].BufferSize];
             Array.Copy((Array)this.callData, this.referenceData[index].BufferOffset, (Array)data, 0, data.Length);
             this.IntegerArguments[index].UnpackReferenceData(data);
         }
     }
 }
コード例 #2
0
        private void WaitForCallCompletion(TimeSpan timeout)
        {
            if (this.NoDevkit)
            {
                return;
            }
            byte[]   numArray = new byte[XDRPCExecutionState.ArgumentSize];
            DateTime now1     = DateTime.Now;
            ulong    fromBigEndianBytes;

            do
            {
                uint BytesReceived;
                this.Console.ReceiveBinary(this.connectionId, numArray, (uint)numArray.Length, out BytesReceived);
                if ((long)BytesReceived != (long)XDRPCExecutionState.ArgumentSize)
                {
                    throw new XDRPCInvalidResponseException("Unexpected binary chunk size received from console");
                }
                fromBigEndianBytes = MarshalingUtils.GetUInt64FromBigEndianBytes(numArray, 0);
                if (fromBigEndianBytes == 997UL)
                {
                    DateTime now2 = DateTime.Now;
                    if (now2.Subtract(now1) > timeout)
                    {
                        throw new XDRPCTimeoutException("Timed out while waiting for function to execute, try setting a longer executionTimeoutPeriod in XDRPCExecutionOptions if longer timeout period is needed", now1, now2, timeout);
                    }
                }
            }while (fromBigEndianBytes == 997UL);
            if (fromBigEndianBytes != 0UL)
            {
                throw new XDRPCInvalidResponseException(string.Format("Received invalid status from console: {0}", (object)fromBigEndianBytes));
            }
        }