[erlang-questions] Interop between net_kernel and erts
Valery Meleshkin
valery.meleshkin@REDACTED
Thu Jul 11 17:25:37 CEST 2013
Hi,
I am wondering how the net_kernel and its subordinated *_dist are wired with ERTS.
My current findings are:
1) net_kernel and *_dist (which in turn uses dist_util and erl_epmd) do local naming setup (erlang:setnode/2), epmd registration/resolution and handshake by themselves.
2) everything is implemented on top of the gen_tcp which is a part of the kernel. gen_tcp is implemented on top of the prim_inet which is a part of so-called "preloaded".
3) I spotted call to the erlang:setnode/3 in dist_util and I suppose it sets a correspondence between a port and a node for the erlang:send.
And here are my questions:
1) Are my findings correct?
2) Is there any protocol between net_kernel (with its neighbors) and ERTS or every known message comes from the "user-space"?
3) Although controlling process of the internode socket sets
inet:setopts(S, [{active, true}, {deliver, port}, {packet, 4}, nodelay()])
after handshake and setnode/3 (see dist_util:connection and FPostNodeup call) there is no data-message handling code inside dist_util:con_loop. So, are those data-messages handled somehow magically within ERTS?
Thanks,
Valery
More information about the erlang-questions
mailing list