コード例 #1
0
ファイル: TestTcpConnection.cs プロジェクト: NeoTim/etch
            public void SessionData(Who sender, FlexBuffer buf)
            {
                xsender = sender;
                xbuf    = buf.GetAvailBytes();

                what.WaitUntilEqAndSet(default(What), TIMEOUT, What.DATA);
            }
コード例 #2
0
        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());
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: TestMessagizer.cs プロジェクト: NeoTim/etch
 public void TransportPacket(Who recipient, FlexBuffer buf)
 {
     what            = What.PACKETSOURCEPACKET;
     this.xrecipient = recipient;
     this.xbuf       = buf.GetAvailBytes();
 }
コード例 #5
0
 public void TransportData(Who recipient, FlexBuffer buf)
 {
     what            = What.DATA;
     this.xrecipient = recipient;
     list.Add(buf.GetAvailBytes());
 }
コード例 #6
0
 public void SessionPacket(Who sender, FlexBuffer buf)
 {
     what    = What.PACKET;
     xsender = sender;
     list.Add(buf.GetAvailBytes());
 }