Skip to content

Instantly share code, notes, and snippets.

@josevalim
Created August 27, 2014 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josevalim/073d630931a6f6624961 to your computer and use it in GitHub Desktop.
Save josevalim/073d630931a6f6624961 to your computer and use it in GitHub Desktop.
+ EPMD
- Distributed systems are cool
- Distributed systems are also complex
- First step: How to find other machines (and nodes) in the same network
- Erlang Port Mapper Daemon
+ EPMD in C
- Ships with Erlang
- is a TCP server
- usually 4369
- binary protocol
- stateful
- replaceable
+ ExPMD
- EPMD written in Elixir
- Pattern matching on binary strings
- Still getting used with immutability
- Using agents to keep data
+ Requests ()
- Alive -- Sent by new node on start-up
Registers named node and port (etc) on local EPMD
Connection remains open until node exits.
- Port -- Receives a node name
Returns port registered with given name
- Names -- return list of all registered names/ports
- wireshark
+ Live demo
- iex --name sophia (alive)
- Node.ping(:"jv@jv.hackerschool.com")
- finds EPMD at jv.hackerschool.com
- asks for node named jv
- :net_adm.names()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment