[erlang-questions] Who called my gen_server?
Andreas Schultz
aschultz@REDACTED
Thu Apr 27 08:52:12 CEST 2017
Hi,
----- On Apr 24, 2017, at 5:43 PM, Frank Muller <frank.muller.erl@REDACTED> wrote:
> Hi guys,
> I've two connected nodes: N1, N2.
> N1 is mine and I've a gen_server running on it.
> N2 is external and doesn't belong to me.
> A process on N2 is calling my gen_server (on N1) via an rpc:call.
You do know that the rpc server is exactly one process per Erlang
node. Pushing to many calls through it will degrade performance.
If you have any influence on the design of node N2, change it to call
your N1 gen_server directly without the intermediate rpc process.
You could either register your server with a global name, use another
global registry (e.g. gproc), or a myriad of other ways to reach your
gen_server without the rpc module.
That way, `From` in the handle_call method will contain the PID of
the caller.
Andreas
> Is there a way to know the Pid of that process?
> Or, can I log all rpc_call(s) calling my gen_server?
> /Frank
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170427/f112bfb5/attachment.htm>
More information about the erlang-questions
mailing list