table of contents
- buster 1:21.2.6+dfsg-1
- testing 1:23.2.6+dfsg-1
- unstable 1:23.2.6+dfsg-1
- experimental 1:24.0.5+dfsg-1
erl_epmd(3erl) | Erlang Module Definition | erl_epmd(3erl) |
NAME¶
erl_epmd - Erlang interface towards epmdDESCRIPTION¶
This module communicates with the EPMD daemon, see epmd. To implement your own epmd module please see ERTS User's Guide: How to Implement an Alternative Service Discovery for Erlang DistributionEXPORTS¶
start_link() -> {ok, pid()} | ignore | {error, term()}
This function is invoked as this module is added as a child of the erl_distribution supervisor.
register_node(Name, Port) -> Result
register_node(Name, Port, Driver) -> Result
Types:
Port = integer() >= 0
Driver = inet_tcp | inet6_tcp | inet | inet6
Creation = integer() >= 0
Result = {ok, Creation} | {error, already_registered} | term()
Registers the node with epmd and tells epmd what port will be used for the current node. It returns a creation number. This number is incremented on each register to help with identifying if a node is reconnecting to epmd.
port_please(Name, Host) -> {ok, Port, Version} | noport
port_please(Name, Host, Timeout) -> {ok, Port, Version} | noport
Types:
Host = inet:ip_address()
Timeout = integer() >= 0 | infinity
Port = Version = integer() >= 0
Requests the distribution port for the given node of an EPMD instance. Together with the port it returns a distribution protocol version which has been 5 since Erlang/OTP R6.
address_please(Name, Host, AddressFamily) -> Success | {error, term()}
Types:
Host = string() | inet:ip_address()
AddressFamily = inet | inet6
Port = Version = integer() >= 0
Success = {ok, inet:ip_address()} | {ok, inet:ip_address(), Port, Version}
Called by the distribution module. Resolves the Host to an IP address.
Another epmd module may return port and distribution protocol version as well.
names(Host) -> {ok, [{Name, Port}]} | {error, Reason}
Types:
Name = string()
Port = integer() >= 0
Reason = address | file:posix()
Called by net_adm:names/0. Host defaults to the localhost. Returns the names and associated port numbers of the Erlang nodes that epmd registered at the specified host. Returns {error, address} if epmd is not operational.
Example:
(arne@dunn)1> erl_epmd:names(localhost). {ok,[{"arne",40262}]}
kernel 6.2 | Ericsson AB |