internal CommunicationFrame() { header = new HeaderFrame(); payload = new PayLoad(); data = ""; serialization = Communication.createSerialization(); }
internal CommunicationFrame(HeaderFrame h, PayLoad p) { data = ""; Header = h; PayLoad = p; serialization = Communication.createSerialization(); }
/** * * Codifica o cabeçalho */ public bool encode(HeaderFrame header) { header.Append(header.Address.ToString("D5") + CONST_CHAR.SEPARATOR); header.Append(header.Dest.ToString("D5") + CONST_CHAR.SEPARATOR); header.Append(header.TimeStamp.ToString("D10") + CONST_CHAR.SEPARATOR); header.Append(header.Operation.ToString() + CONST_CHAR.SEPARATOR); header.Append(header.Resource); return(true); }
/* * Decodifica um header fazendo a conversão de uma lista de string para seu respectivo formato original */ private HeaderFrame decoderHeader(string[] list) { HeaderFrame header = new HeaderFrame(); FieldFrame <int> addr = new FieldFrame <int>(INDEX.ADDRESS, list); FieldFrame <int> dest = new FieldFrame <int>(INDEX.DEST, list); FieldFrame <Int32> timestamp = new FieldFrame <Int32>(INDEX.TIME_STAMP, list); FieldFrame <Operation> op = new FieldFrame <Operation>(INDEX.OPERACAO, list); FieldFrame <string> res = new FieldFrame <string>(INDEX.RESOURCE, list); FieldFrame <int> s_pl = new FieldFrame <int>(INDEX.SIZE_PAYLOAD, list); header.Address = addr.getVal(); header.Dest = dest.getVal(); header.TimeStamp = timestamp.getVal(); header.Operation = op.getVal(); header.Resource = res.getVal(); header.SizePayLoad = s_pl.getVal(); return(header); }
internal FrameAMQP(HeaderFrame h, PayLoad p) : base(h, p) { }
internal FrameSerial(HeaderFrame h, PayLoad p) : base(h, p) { }