erl_dist
Rust Implementation of Erlang Distribution Protocol.
The distribution protocol is used to communicate with distributed erlang nodes.
Examples
Gets a node entry from EPMD:
use ;
// Connect to the local EPMD.
let connection = connect.await?;
let client = new;
// Get the information of a node.
let node_name = "foo";
if let Some = client.get_node.await? else
Sends a message to an Erlang node:
use LOWEST_DISTRIBUTION_PROTOCOL_VERSION;
use ;
use ClientSideHandshake;
use ;
use ;
// Connect to a peer node.
let peer_host = "localhost";
let peer_port = 7483; // NOTE: Usually, port number is retrieved from EPMD.
let connection = connect.await?;
// Local node information.
let creation = random;
let local_node = new;
// Do handshake.
let mut handshake = new;
let _status = handshake.execute_send_name.await?;
let = handshake.execute_rest.await?;
// Create a channel.
let capability_flags = local_node.flags & peer_node.flags;
let = channel;
// Send a message.
let from_pid = new;
let to_name = from;
let msg = reg_send;
tx.send.await?;
Example commands:
- EPMD Client Example: epmd_cli.rs
- Client Node Example: send_msg.rs
- Server Node Example: recv_msg.rs