Client-side connection objects must now provide both client and server
endpoint types. When a message is received from the server side, we try
to decode it using both endpoint types and then send it to the right
place for handling.
This now makes it possible for AudioServer to send unsolicited messages
to its clients. This opens up a ton of possibilities :^)
This was happening for async (response-less) messages, since they were
returning void and were were always just wrapping the return type in
an OwnPtr no matter what.
- Add IEndpoint::handle(IMessage), a big switch table on message type.
handle() will return a response message for synchronous messages,
and return nullptr otherwise.
- Use i32 instead of int for everything
- Make IMessage::encode() const
- Make IEndpoint::decode_message() static, this allows template code to
decode messages without an endpoint instance on hand.
Each message will now have a typedef called ResponseType as an alias
for the expected response type. This will aid in implementing the sync
messaging code.
Instead of doing everything manually in C++, let's do some codegen.
This patch adds a crude but effective IPC definition parser, along
with two initial definition files for the AudioServer's client and
server endpoints.