示例#1
0
            public async Task <InteropResponse> GetResponse()
            {
                InteropResponse response = new InteropResponse
                {
                    header = new InteropResponseHeader()
                };

                byte[] responseHeaderArray = new byte[Marshal.SizeOf(response.header)];
                await DataStream.ReadAsync(responseHeaderArray, 0, responseHeaderArray.Length);

                MarshalArrayToObject(ref response.header, responseHeaderArray);

                response.responseData = new byte[response.header.ResponsePayloadSize];
                if (response.header.ResponsePayloadSize > 0)
                {
                    await DataStream.ReadAsync(response.responseData, 0, response.header.ResponsePayloadSize);
                }

                return(response);
            }
示例#2
0
 public InteropRequest()
 {
     header      = new InteropRequestHeader();
     response    = new InteropResponse();
     requestData = null;
 }