Reputation: 2490
The base problem is as follows:
This would be easily solved with two sockets but I have only one. You can think of the problem as having to create multiple virtual sockets/channels over a single socket. Do you know of a well-tested messaging library that would support such use case?
In addition:
I'd prefer not to have to write my own library and use something which is well-tested and well-support. I've looked into ZeroMQ but it doesn't seem to support the third requirement (request-reply pattern from A to B and from B to A simultaneously over a single socket). RabbitMQ is another possibility but may not support this requirement either. (I don't have experience with these libraries so maybe I'm wrong...)
(I wonder if I'm asking for too much.)
Upvotes: 1
Views: 1992
Reputation: 45171
I don't have a complete answer for you, but I note that what you're asking for is emphatically supported by Cap'n Proto's RPC protocol: calls can be initiated in either direction.
It's not exactly what you want because:
But it might be worth checking out, for inspiration if nothing else.
(Disclosure: I'm the author of Cap'n Proto, and also the author of most of Google's open source Protobuf code.)
Upvotes: 2