Exemplo n.º 1
0
        public static byte[] BuildResponseMessage(RemotingResponse response)
        {
            var requestSequenceBytes     = BitConverter.GetBytes(response.RequestSequence);
            var requestCodeBytes         = BitConverter.GetBytes(response.RequestCode);
            var requestTypeBytes         = BitConverter.GetBytes(response.RequestType);
            var requestTimeBytes         = ByteUtil.EncodeDateTime(response.RequestTime);
            var requestHeaderBytes       = HeaderUtil.EncodeHeader(response.RequestHeader);
            var requestHeaderLengthBytes = BitConverter.GetBytes(requestHeaderBytes.Length);

            var responseCodeBytes         = BitConverter.GetBytes(response.ResponseCode);
            var responseTimeBytes         = ByteUtil.EncodeDateTime(response.ResponseTime);
            var responseHeaderBytes       = HeaderUtil.EncodeHeader(response.ResponseHeader);
            var responseHeaderLengthBytes = BitConverter.GetBytes(requestHeaderBytes.Length);

            return(ByteUtil.Combine(
                       requestSequenceBytes,
                       requestCodeBytes,
                       requestTypeBytes,
                       requestTimeBytes,
                       requestHeaderLengthBytes,
                       requestHeaderBytes,
                       responseCodeBytes,
                       responseTimeBytes,
                       responseHeaderLengthBytes,
                       responseHeaderBytes,
                       response.ResponseBody));
        }
Exemplo n.º 2
0
        private static byte[] BuildRemotingServerMessage(RemotingResponse remotingResponse)
        {
            byte[] remotingResponseData  = RemotingUtil.BuildResponseMessage(remotingResponse);
            var    remotingServerMessage = new RemotingServerMessage(
                RemotingServerMessageType.RemotingResponse,
                100,
                remotingResponseData,
                null);

            return(RemotingUtil.BuildRemotingServerMessage(remotingServerMessage));
        }
Exemplo n.º 3
0
 public bool SetResponse(RemotingResponse response)
 {
     return(_taskSource.TrySetResult(response));
 }