code: def _init_multicast_socket(self):
          
          self.debug("()")
          # Create a UDP socket
          self._multicast_socket = socket.socket(
              socket.AF_INET,
              socket.SOCK_DGRAM
          )
  
          # Allow reuse of addresses
          self._multicast_socket.setsockopt(
              socket.SOL_SOCKET,
              socket.SO_REUSEADDR,
              1
          )
  
          # Set multicast interface to local_ip
          self._multicast_socket.setsockopt(
              socket.IPPROTO_IP,
              socket.IP_MULTICAST_IF,
              socket.inet_aton(self._multicast_ip)
          )
  
          # Set multicast time-to-live
          # Should keep our multicast packets from escaping the local network
          self._multicast_socket.setsockopt(
              socket.IPPROTO_IP,
              socket.IP_MULTICAST_TTL,
              self._multicast_ttl
          )
  
          self._add_membership_multicast_socket()
          # Bind socket
          if platform.system().lower() == "darwin":
              self._multicast_socket.bind(("0.0.0.0", self._multicast_bind_port))
          else:
              self._multicast_socket.bind(
                  (self._multicast_ip, self._multicast_bind_port)
              )
          self._listening.append(self._multicast_socket)
docs: Init multicast socket
  
          :rtype: None