1
votes

I want to develop a Qt5/C++ client-server application using remote procedure calls (RPC).

Idea: The server listens for incoming connections of multiple clients. Clients offer a set of procedures/services the server can call in order to collect data from clients and inform other clients about changes.

And here is the catch: The RPC libs i've seen so far seem to expect the server to offer a service the clients may call. But I want to do the opposite. Clients should offer services the server may call. The direction is important, because I want to enable port forwarding on the server side only, not on the client side.

The libs I've checked are:

Questions:

  • Is there a reason these libs offer services on server side only?
  • Did I maybe only miss that part in the documentation?
  • Is there an RPC lib that does offer client side service offering?
1
Please confirm: It sounds like you want A connects to B and offers services to B.user4581301
Yes, thats how it's supposed to work.Simpl
Don't know of any off hand. Have you considered A opens tunnel to B, B connects to and requests services from A through the tunnel?user4581301
You have asked 3 questions about libraries you look in and we can mostly answer in terms of tags: C++ / Qt / RPC. That makes us study those 3rd party libraries? I can probably offer you something how to work around such demand but the 3 questions aren't about that.Alexander V
I don't expect anyone to study libraries for me :) Maybe someone has already had experience with a lib and found a way to offer services on client side. I would really like to know your workarounds for my problem.Simpl

1 Answers

2
votes

gRPC supports bidirectional streaming, which may meet your needs.

Clients can open a long lived connection to a server, and then the server can "call" the clients by sending responses on the stream.

The client can respond by sending another message on the stream.

http://www.grpc.io/docs/tutorials/basic/c.html