1erl_epmd(3) Erlang Module Definition erl_epmd(3)
2
3
4
6 erl_epmd -
7 Erlang interface towards epmd
8
9
11 This module communicates with the EPMD daemon, see epmd. To implement
12 your own epmd module please see ERTS User's Guide: How to Implement an
13 Alternative Node Discovery for Erlang Distribution
14
16 start_link() -> {ok, pid()} | ignore | {error, term()}
17
18 This function is invoked as this module is added as a child of
19 the erl_distribution supervisor.
20
21 register_node(Name, Port) -> Result
22
23 register_node(Name, Port, Driver) -> Result
24
25 Types:
26
27 Name = string()
28 Port = integer() >= 0
29 Driver = inet_tcp | inet6_tcp | inet | inet6
30 Creation = integer() >= 0 | -1
31 Result = {ok, Creation} | {error, already_registered} |
32 term()
33
34 Registers the node with epmd and tells epmd what port will be
35 used for the current node. It returns a creation number. This
36 number is incremented on each register to help differentiate a
37 new node instance connecting to epmd with the same name.
38
39 After the node has successfully registered with epmd it will au‐
40 tomatically attempt reconnect to the daemon if the connection is
41 broken.
42
43 port_please(Name, Host) ->
44 {port, Port, Version} |
45 noport | closed |
46 {error, term()}
47
48 port_please(Name, Host, Timeout) ->
49 {port, Port, Version} |
50 noport | closed |
51 {error, term()}
52
53 Types:
54
55 Name = atom() | string()
56 Host = atom() | string() | inet:ip_address()
57 Timeout = integer() >= 0 | infinity
58 Port = Version = integer() >= 0
59
60 Requests the distribution port for the given node of an EPMD in‐
61 stance. Together with the port it returns a distribution proto‐
62 col version which has been 5 since Erlang/OTP R6.
63
64 listen_port_please(Name, Host) -> {ok, Port}
65
66 Types:
67
68 Name = atom() | string()
69 Host = atom() | string() | inet:ip_address()
70 Port = integer() >= 0
71
72 Called by the distribution module to get which port the local
73 node should listen to when accepting new distribution requests.
74
75 address_please(Name, Host, AddressFamily) ->
76 Success | {error, term()}
77
78 Types:
79
80 Name = string()
81 Host = string() | inet:ip_address()
82 AddressFamily = inet | inet6
83 Port = Version = integer() >= 0
84 Success =
85 {ok, inet:ip_address()} |
86 {ok, inet:ip_address(), Port, Version}
87
88 Called by the distribution module to resolves the Host to an IP
89 address of a remote node.
90
91 As an optimization this function may also return the port and
92 version of the remote node. If port and version are returned
93 port_please/3 will not be called.
94
95 names(Host) -> {ok, [{Name, Port}]} | {error, Reason}
96
97 Types:
98
99 Host = atom() | string() | inet:ip_address()
100 Name = string()
101 Port = integer() >= 0
102 Reason = address | file:posix()
103
104 Called by net_adm:names/0. Host defaults to the localhost. Re‐
105 turns the names and associated port numbers of the Erlang nodes
106 that epmd registered at the specified host. Returns {error, ad‐
107 dress} if epmd is not operational.
108
109 Example:
110
111 (arne@dunn)1> erl_epmd:names(localhost).
112 {ok,[{"arne",40262}]}
113
114
115
116Ericsson AB kernel 8.5.4.2 erl_epmd(3)