How does one actor get remote actor ip within one group?
For example, I have two actors A and B which both joined one group chatroom. A and B were spawned on different machines.
Then B send one messge to the group and A can receive and act. Now A wants to know the IP of B for each received message from B. Is there any way to implenment this function?
I found one similar answer from https://github.com/actor-framework/actor-framework/issues/419. But I am not sure this is also proper for group.
When receiving a message, you can get a handle to the sender by calling
self->current_sender(). Then you can get thenode_idfrom this handle and, if it's different from your ownnode_id, ask the middleman about connection details.However, this is not part of the stable API. This means it is likely to change, so keep this in mind.