Hi,
I need to use parameters of std::vectorstd::string type for my RPC program, but it doesn't seem to work. (I want to define a RPC function passing varible number of strings as a parameter. The number of strings is very flexible.) I read about the transferable argument types from the 11.05 release notes. If vector isn't one of the transferable argument type, could you give me an alternative programming tip? Thank you.
Best, Bokdeuk Jeong
Hello 정복득,
On Thu, Jul 12, 2012 at 09:16:19AM +0000, 정복득 wrote:
I need to use parameters of std::vectorstd::string type for my RPC program, but it doesn't seem to work. (I want to define a RPC function passing varible number of strings as a parameter. The number of strings is very flexible.) I read about the transferable argument types from the 11.05 release notes.
The RPC mechanism does not support (de)marshalling of complex types like std::vectorstd::string as the serialization of such types cannot be implemented in a generic way but needs type-specific serialization functions.
If vector isn't one of the transferable argument type, could you give me an alternative programming tip?
This issue comes up from time to time and we always encourage the users to enter a discussion about what they really want to achieve resp. to clarify the details of the use case. So, please allow me to give some background information:
* The RPC mechanism is just one basic synchronous communication mechanism. Therefore, it's suited for configuration interfaces and interfaces with simple parameters, i.e. C++ base or POD types. The mechanism is not inteded to support structured bulk traffic with complex serialization tasks.
* The base mechanism used for RPC is the IPC mechanism of the base platform, which is usually limited with regard to the maximum message size. For Fiasco.OC, the limiting factor is the size of the UTCB.
* Besides RPC, Genode also supports the packet-stream interface, which is a packet-based shared-memory mechanism (see os/include/os/packet_stream.h and os/include/packet_stream_rx/tx). The packet stream is well suited for bulk traffic and also supports asynchronous operation.
With this background, we could revisit your usage scenario and come up with an approach that fits best.
Unfortunately, the serialization of std::vectorstd::string is in any case out of the scope of the base framework, but should not be that hard.
Regards