public void SessionData(Who sender, FlexBuffer buf) { xsender = sender; xbuf = buf.GetAvailBytes(); what.WaitUntilEqAndSet(default(What), TIMEOUT, What.DATA); }
private byte[] Msg2bytes(Message msg, bool?stringTypeAndField) { FlexBuffer buf = new FlexBuffer(); URL u = new URL("none:"); if (stringTypeAndField != null) { u.AddTerm(BinaryTaggedDataOutput.STRING_TYPE_AND_FIELD, stringTypeAndField.ToString()); } BinaryTaggedDataOutput btdo = new BinaryTaggedDataOutput(vf, u.ToString()); btdo.WriteMessage(msg, buf); buf.SetIndex(0); return(buf.GetAvailBytes()); }
private void assertValueToBytes(Object value, sbyte[] expectedBytes) { XType t = new XType(1, "a"); Field f = new Field(2, "b"); t.PutValidator(f, Validator_object.Get(0)); Message msg = new Message(t, vf); msg.Add(f, value); BinaryTaggedDataOutput btdo = new BinaryTaggedDataOutput(vf, "none:"); FlexBuffer buf = new FlexBuffer(); btdo.WriteMessage(msg, buf); buf.SetIndex(0); byte[] b = buf.GetAvailBytes(); sbyte[] b1 = new sbyte[b.Length]; Buffer.BlockCopy(b, 0, b1, 0, b.Length); Dump(b); AssertArrayEquals(expectedBytes, b1); }
public void TransportPacket(Who recipient, FlexBuffer buf) { what = What.PACKETSOURCEPACKET; this.xrecipient = recipient; this.xbuf = buf.GetAvailBytes(); }
public void TransportData(Who recipient, FlexBuffer buf) { what = What.DATA; this.xrecipient = recipient; list.Add(buf.GetAvailBytes()); }
public void SessionPacket(Who sender, FlexBuffer buf) { what = What.PACKET; xsender = sender; list.Add(buf.GetAvailBytes()); }