Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang: is there an API to 'epmd'?

Tags:

erlang

Is there a way to query the name table that epmd daemon manages?

The nodes() function isn't very helpful on that front.

NOTE: I am looking for an API aside from parsing the output generated through stdout.

like image 944
jldupont Avatar asked Sep 25 '09 16:09

jldupont


1 Answers

To query nodes visible for epmd, call:

EpmdModule = net_kernel:epmd_module().  % erl_epmd by default
EpmdModule:names().

To get a list of connected nodes and their ports:

erlang:system_info(dist).
erlang:system_info(dist_ctrl).

The first call returns you the table in a crash dump format. If you are interested in acquiring the actual ports, use the second one.

like image 158
Zed Avatar answered Oct 26 '22 01:10

Zed