Elixium Core v0.2.2 Elixium.P2P.ConnectionHandler View Source

Manage inbound and outbound connections

Link to this section Summary

Functions

Accept an incoming connection from a peer and decide whether they are a new peer or someone we’ve talked to previously, and then authenticate them accordingly

Spawn a new handler, check to see if it knows of any possible peers. If there is a peer that it knows of, it will attempt a connection to that peer. If the connection fails or if it does not know of any peers, just sets up a listener and await an authentication message from another peer

Link to this section Functions

Link to this function accept_inbound_connection(listen_socket, master_pid, oracle) View Source
accept_inbound_connection(reference(), pid(), pid()) :: none()

Accept an incoming connection from a peer and decide whether they are a new peer or someone we’ve talked to previously, and then authenticate them accordingly

Link to this function attempt_outbound_connection(arg, had_previous_connection, credentials, socket, master_pid, oracle) View Source
Link to this function start_link(socket, pid, peers, handler_number, oracle) View Source
start_link(reference(), pid(), List, integer(), pid()) :: {:ok, pid()}

Spawn a new handler, check to see if it knows of any possible peers. If there is a peer that it knows of, it will attempt a connection to that peer. If the connection fails or if it does not know of any peers, just sets up a listener and await an authentication message from another peer.