pyrlang.dist_proto.server

The module implements incoming TCP dist_proto protocol (i.e. initiated by another node with the help of EPMD). Protocol only performs handling of incoming data, the socket is handled by the Async Engine (pyrlang.async).

class pyrlang.dist_proto.server.DistServerProtocol(node_name)

Bases: BaseDistProtocol

Protocol handles incoming connections from other nodes.

alive_peer_

Name of the peer that was told ‘alive’ and has not answered.

connection_lost(exc)

The connection ended; its peer, if the handshake was over, is down.

on_packet(data)

Handle incoming dist_proto packet

Parameters:

data (bytes) – The packet after the header had been removed

on_packet_recvname(data)

Handle RECV_NAME command, the first packet in a new connection: check the peer’s flags and answer with a status, as dist_util:handshake_other_started does.

on_packet_alive_reply(data)

The initiator’s answer to status alive (dist_util:recv_status_reply).

on_packet_challengereply(data)

The initiator’s answer to our challenge and its own challenge: check one, answer the other.