3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper ================================================ .. py:module:: 3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper Attributes ---------- .. autoapisummary:: 3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper.PROTOCOL_VERSION 3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper.MAGIC 3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper.HDR_ANNOUNCE Classes ------- .. autoapisummary:: 3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper.BroadcastBootstrapEndpoint 3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper.UDPBroadcastBootstrapper Module Contents --------------- .. py:data:: PROTOCOL_VERSION :value: b'\x00\x00' .. py:data:: MAGIC :value: b'IPv8' .. py:data:: HDR_ANNOUNCE .. py:class:: BroadcastBootstrapEndpoint(overlay: 3.0.ipv8.types.Community) Bases: :py:obj:`asyncio.DatagramProtocol` Endpoint that opens a broadcast socket. .. py:attribute:: _socket :type: socket.socket | None :value: None .. py:attribute:: _transport :type: asyncio.BaseTransport | None :value: None .. py:attribute:: overlay .. py:attribute:: logger .. py:method:: open() -> bool :async: Open the broadcast socket. .. py:method:: send(socket_address: 3.0.ipv8.types.Address, data: bytes) -> None Attempt to send data to the given socket address and silently fail. .. py:method:: datagram_received(data: bytes, addr: 3.0.ipv8.types.Address) -> None We received data on our broadcast socket. Note that we do not use the broadcast socket but the overlay socket to send a reply. .. py:method:: close() -> None Close this endpoint. .. py:class:: UDPBroadcastBootstrapper(bootstrap_timeout: float = 30.0) Bases: :py:obj:`3.0.ipv8.bootstrapping.bootstrapper_interface.Bootstrapper` Bootstrapper that finds peers by iterating over ALL 65k ports of the local broadcast address. .. py:attribute:: endpoint :type: BroadcastBootstrapEndpoint | None :value: None .. py:attribute:: overlay :type: 3.0.ipv8.types.Community | None :value: None .. py:attribute:: bootstrap_timeout .. py:attribute:: last_bootstrap :type: float :value: 0 .. py:method:: initialize(overlay: 3.0.ipv8.types.Community) -> bool :async: Initialize this bootstrapper for the given overlay. .. py:method:: beacon(service_prefix: bytes) -> None Try to find a listener (fire and forget). .. py:method:: get_addresses(overlay: 3.0.ipv8.types.Community, timeout: float) -> collections.abc.Iterable[3.0.ipv8.types.Address] :async: Attempt to find addresses. This method will never return addresses immediately. .. py:method:: keep_alive(overlay: 3.0.ipv8.types.Community) -> None Send a "keep alive" message. .. py:method:: blacklist() -> collections.abc.Iterable[3.0.ipv8.types.Address] Get the blacklisted addresses. .. py:method:: unload() -> None Stop this bootstrapper.