Closed Stuart0l closed 11 months ago
The second way is correct and recommended.
There might be a bug in eRPC that prevents the first way from working, caused by the use of thread-local variables for tracking (https://github.com/erpc-io/eRPC/blob/615aa9373e74cc270adae51267e0a1912848bbd0/src/util/tls_registry.h#L10C19-L10C28).
Hi Anuj, thanks for your answer!
I'm trying to connect to multiple erpc servers from one client (single thread). I used two methods, one is to use a separate erpc::Rpc object for each connection like this:
but this does not work. The rpc request can't be delivered to the server. The other way is to use the same erpc::Rpc object for both connections like this:
This way it works and rpc requests can be delivered to servers. So is the second way the correct way to use and why the first way fails to work?
Thanks!