epmd.epmd_server¶
The EPMD server and its table of registered nodes.
- class epmd.epmd_server.Epmd(host=None, port=4369, *, addresses=None, packet_timeout=60.0, relaxed_command_check=False, max_connections=1024)¶
Bases:
objectListens on the EPMD protocol port and handles discovery of running Erlang nodes on this host.
- EPMD_DEFAULT_PORT = 4369¶
- DEFAULT_PACKET_TIMEOUT = 60.0¶
- DEFAULT_MAX_CONNECTIONS = 1024¶
- async start()¶
Start listening and return once the socket listens.
Afterwards
self.portis the bound port (useful withport=0; every address then gets the port the first one got).
- async stop()¶
Stop listening and close every client connection. Registered nodes are forgotten. Calling it again, or before
start, is safe.
- async start_server()¶
Start listening and serve until cancelled or stopped (
stop()or a KILL_REQ); then stop.- Raises:
OSError – the port is in use, typically by another EPMD.
- register(node_name, data)¶
Attempts to register a node. Returns True if successful, False if the node is already registered.
Sets
data.cr_counter: one more than at the name’s previous registration if it is remembered, else a random start.
- unregister(node_name)¶
Called from EpmdProtocol when a client disconnects or when a STOP command arrives (documentation claims this is not used but still implemented). Removes the node from the list of nodes.