erpc-io / eRPC

Efficient RPCs for datacenter networks
https://erpc.io/
Other
835 stars 137 forks source link

Can a server thread (registered function) send a new eRPC request back to the client (same session) after responding to the first eRPC request? #79

Closed psistakis closed 2 years ago

psistakis commented 2 years ago

Hi.

Assuming two nodes, where each can act both as a server and as a client (e.g. a client sends an eRPC request first and then it just continuously runs the event loop) --is there a way for a server thread (registered function) to first send the response to the eRPC request serviced, and then send a new eRPC request to the client (same session)?

Based on the examples I have seen so far, it seems that in each session only a client can send requests to a server, and not vice versa: is this correct?

If my understanding is correct, is there any way to achieve what I am describing? I would appreciate it if you could share any examples or any hints on how this could be achieved (I have an idea about using a queue, but it would require careful handling for races).

Thank you.

anujkaliaiitd commented 2 years ago

Hi Antonis. In eRPC, only the thread that creates a session can send requests on that session. In your case, the server will need to create an additional session to the client to send requests to the client.

psistakis commented 2 years ago

Hi Dr Kalia: thanks for the clarification.

WWaynee commented 3 months ago

Hi Dr Kalia: thanks for the clarification.

Hi Antonis, did you successfully implement creating another session to the client? I don't know how to do that, should I create the session in the request handler function?

psistakis commented 3 months ago

Hi Dr Kalia: thanks for the clarification.

Hi Antonis, did you successfully implement creating another session to the client? I don't know how to do that, should I create the session in the request handler function?

Hi, yes --I implemented a connect_sessions_serv() that is called from the server and creates sessions to the client.