I am seeing the following message on Linux upon calling 
StreamFdMessageReader on the receiving end of a connection. I did have this 
working until I put messages inside a union as a wrapper.

Exception in setting up sender: capnp/layout.c++:2438: failed: expected 
ref-kind() == WirePointer::LIST [0 == 1]; Message contains non-list pointer 
where text was expected.

I'm guessing something is wrong on the sender as the receiving seems to 
only report the problem as soon as it reads from the fd. I am mainly 
confused about the WirePointer::LIST [0 == 1] part. Can anyone add 
clarification?


struct MyObjA {
    fieldA @0 :SomeType;
    fieldB @1 :UInt16;
    fieldC @2 :Text;
}

struct MyObjB {
    fieldA @0 :SomeType;
    fieldB @1 :UInt16;
    fieldC @2 :Text;
}

struct MyWrapper {
    union {
        objA @0 :MyObjA;
        objB @1 :MyObjB;
    }
}

auto w = builder->initRoot<MyWrapper>();
auto obj = w->initMyObjA();

obj.getMyObjA.setFieldA("a");
obj.getMyObjA.setFieldB("b");

writeMessageToFd(fd, builder);



-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capnproto+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/8f592f53-8f03-42f2-831a-c8840f5150d1n%40googlegroups.com.

Reply via email to