Exemple #1
0
        public static RequestArgument ReadFromBinaryReader(BinaryReader reader)
        {
            var argId    = (ArgumentId)reader.ReadInt32();
            var argIndex = reader.ReadInt32();
            var value    = ServerProtocol.ReadLengthPrefixedString(reader);

            return(new RequestArgument(argId, argIndex, value));
        }
Exemple #2
0
        public static CompletedServerResponse Create(BinaryReader reader)
        {
            var returnCode  = reader.ReadInt32();
            var utf8Output  = reader.ReadBoolean();
            var output      = ServerProtocol.ReadLengthPrefixedString(reader);
            var errorOutput = ServerProtocol.ReadLengthPrefixedString(reader);

            return(new CompletedServerResponse(returnCode, utf8Output, output, errorOutput));
        }
        public static CompletedServerResponse Create(BinaryReader reader)
        {
            var returnCode  = reader.ReadInt32();
            var utf8Output  = reader.ReadBoolean();
            var output      = ServerProtocol.ReadLengthPrefixedString(reader);
            var errorOutput = ServerProtocol.ReadLengthPrefixedString(reader);

            if (!string.IsNullOrEmpty(errorOutput))
            {
                throw new InvalidOperationException();
            }

            return(new CompletedServerResponse(returnCode, utf8Output, output));
        }