示例#1
0
        public BeginRequestBody(Record record)
        {
            if (record.Type != RecordType.BeginRequest)
                throw new ArgumentException (
                    Strings.BeginRequestBody_WrongType,
                    "record");

            if (record.BodyLength != 8)
                throw new ArgumentException (
                    Strings.BeginRequestBody_WrongSize, "record");

            byte[] body = record.GetBody ();
            role  = (Role) Record.ReadUInt16 (body, 0);
            flags = (BeginRequestFlags) body [2];
        }
示例#2
0
        public BeginRequestBody(Record record)
        {
            if (record.Type != RecordType.BeginRequest)
                throw new ArgumentException (
                    Strings.BeginRequestBody_WrongType,
                    "record");

            if (record.BodyLength != 8)
                throw new ArgumentException (
                    String.Format(Strings.BeginRequestBody_WrongSize, record.BodyLength), "record");

            IReadOnlyList<byte> body;
            record.GetBody (out body);
            role  = (Role) Record.ReadUInt16 (body, 0);
            flags = (BeginRequestFlags) body [2];
        }
示例#3
0
文件: Connection.cs 项目: ryepup/xsp
        void HandleParams(Request request, Record record)
        {
            if (request == null) {
                StopRun (Strings.Connection_RequestDoesNotExist, record.RequestID);
                return;
            }

            request.AddParameterData (record.GetBody ());
        }
示例#4
0
文件: Connection.cs 项目: ryepup/xsp
        void HandleGetValues(Record record)
        {
            byte[] response_data;

            // Look up the data from the server.
            try {
                IDictionary<string, string> pairs_in = NameValuePair.FromData (record.GetBody ());
                IDictionary<string, string> pairs_out = server.GetValues (pairs_in.Keys);
                response_data = NameValuePair.GetData (pairs_out);
            } catch {
                response_data = new byte[0];
            }

            SendRecord (RecordType.GetValuesResult, record.RequestID, response_data);
        }
示例#5
0
文件: Connection.cs 项目: symform/xsp
        void HandleParams(Request request, Record record)
        {
            if (request == null) {
                StopRun (Strings.Connection_RequestDoesNotExist, record.RequestID);
                return;
            }

            IReadOnlyList<byte> body;
            record.GetBody (out body);
            request.AddParameterData (body);
        }