在《Erlang/OTP 併發編程實戰》中,對 epmd 有以下描述: css
在《Learn You Some Erlang for Great Good!》中有以下描述: node
When you start a node, you give it a name, and it will connect to an application called Erlang Port Mapper Daemon (EPMD), which will run on each of the computers that are part of your Erlang cluster. EPMD will act as a name server that lets nodes register themselves, contact other nodes by name rather than port numbers, and warn you about any name clashes.
If you need to go through a firewall with distributed Erlang (and do not want to tunnel), you will likely want to open a few ports here and there for Erlang communication. In this case, you should open port 4369, the default port for EPMD. It’s a good idea to use this port, because it has been officially registered for EPMD by Ericsson. This means that any standards-compliant operating system you use will have that port free, ready for EPMD.
在 otp_src_xxx\erts\epmd\ 中,實現了 epmd 服務程序和 epmd 命令行程序。
【epmd.c】
linux
【epmd.h】
定義了 epmd 所採用協議的消息編碼(C語言側定義)。
【epmd_int.h】
針對跨平臺函數和變量進行定義。
【epmd_cli.c】
實現了 epmd 命令行功能所需的的 API 調用。
【epmd_srv.c】
編程
在 otp_src_xxx\lib\kernel\src\ 中,在 erlang 代碼層面實現了與 epmd 服務程序的協議交互。
【erl_epmd.erl】
基於 gen_server 行爲模式、採用 TCP socket 方式與本地或遠端 epmd 進行協議通訊的實現。
【erl_epmd.hrl】
定義了 epmd 所使用協議的消息編碼(Erlang 語言側定義)。
在 otp_src_xxx\lib\erl_interface\src\epmd\ 中,與 erlang 層實現對應的底層 C 實現。
【ei_epmd.h】
常量定義。
【epmd_port.c】
經過 TCP socket 鏈接本地或遠端 epmd ,並經過協議 EPMD_PORT2_REQ 獲取 the distribution port of another node 。
【epmd_publish.c】
經過協議 EPMD_ALIVE2_REQ 向隱藏 node 發佈自身的 listen port 和 alive name。
【epmd_unpublish.c】
經過協議 EPMD_STOP_REQ 中止指定名字的 node。
windows
erts-5.9.2 中的內容
1
2
3
4
5
6
7
8
9
erts-7.1 中的內容
10
11 併發