Fetching Client Information (ip and port)

16 views
Skip to first unread message

Tanzeela Younas

unread,
Dec 3, 2021, 8:09:57 AM12/3/21
to actor-framework
Being a simple server,  Is there any way to know the ip address and port or either of the client who requested?

Server resembles like below :

behavior calculator_fun() {
  return {
    [](add_atom, int a, int b) { return a + b; },
    [](sub_atom, int a, int b) { return a - b; },
  };
}

Dominik Charousset

unread,
Dec 9, 2021, 3:20:39 AM12/9/21
to actor-f...@googlegroups.com
The messaging layer is network transparent. So at the level of actor handles, there is no network information available in general. There are node IDs associated to actor handles, but there is no API available at the moment to resolve them to network addresses.

The only place where you could access such information is when writing a broker (an actor doing network I/O using connection handles).

Dominik

Tanzeela Younas

unread,
Dec 17, 2021, 12:24:12 AM12/17/21
to actor-framework
So is there any way to to know the actors who are communicating with the server actor?

I know in other thread, You have mentioned that it is not possible as it is only possible with applying some technique on brokers. Can you please explain how can  i achieve the functionality to know who is the client who accessed the server?

Or Basically it is not possible with CAF?
Thanks


Dominik Charousset

unread,
Dec 21, 2021, 1:54:31 AM12/21/21
to actor-f...@googlegroups.com
> So is there any way to to know the actors who are communicating with the server actor?

Actors, yes. You can as for `current_sender()`. You can also ask for their node ID to keep track of different hosts in the network. However, there is no API in place to resolve a node ID to a host:port pair. We are thinking of switching to URI-based node IDs and move away from opaque identifiers, but I can’t give you a timeline on that at the moment.

Dominik
Reply all
Reply to author
Forward
0 new messages