Q: where do these tcp connections come from ?
Tue Sep 18 18:33:20 CEST 2001
"Reto Kramer" <> wrote:
>Q: is there a specific reason why the existing connection (e.g. 3) could not
>have been used for the world_list traffic?
The epmd protocol is rather trivial (see erts/epmd/src/epmd_srv.c and
erts/emulator/internal_doc/erl_ext_dist.txt): You send it a command and
get a response - and then connection is closed, with the exception of
the "alive-connection" that epmd uses for "monitoring" of the Erlang
node. That connection is no exception to the first rule though, you
can't send subsequent commands on it and the "monitoring" consists of
noticing when the connection is closed.
>Q: from a naive look at world_list, ping and gen:call I cannot figure out
>why world_list behaves differently from a plain "ping" in terms of
>connection multiplexing. Can someone explain why?
In the process of word_list()'s work, names() is called to get a list of
known nodes from epmd - it ends up needing a new connection for that
request per above. In contrast, "ping" doesn't need to (directly or
indirectly) make such a request, it already knows the node it's going to
(the distribution mechanism will make a request on ping's behalf to find
the port number of the destination node - but only if there isn't
already an established connection to that node, of course).
More information about the erlang-questions