void HandleParams(Request request, NRecord record) { if (request == null) { StopRun(Strings.Connection_RequestDoesNotExist, record.RequestID); return; } IReadOnlyList <byte> body = record.GetBody(); request.AddParameterData(body); }
internal BeginRequestBody (NRecord 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 (); role = NRecord.ReadRole (body); flags = (BeginRequestFlags) body [2]; }
void HandleGetValues(NRecord record) { byte[] response_data; // Look up the data from the server. try { IReadOnlyList <byte> body = record.GetBody(); IDictionary <string, string> pairs_in = NameValuePair.FromData(body); 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); }
internal BeginRequestBody(NRecord 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(); role = NRecord.ReadRole(body); flags = (BeginRequestFlags)body [2]; }
void HandleGetValues (NRecord record) { byte[] response_data; // Look up the data from the server. try { IReadOnlyList<byte> body = record.GetBody (); IDictionary<string, string> pairs_in = NameValuePair.FromData (body); 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); }
void HandleParams (Request request, NRecord record) { if (request == null) { StopRun (Strings.Connection_RequestDoesNotExist, record.RequestID); return; } IReadOnlyList<byte> body = record.GetBody (); request.AddParameterData (body); }
public byte[] GetData() { return(record.GetBody().ToArray()); }