def _initsocket(self):
        """bind to the datagram socket (UDP), and enable BROADCAST mode"""
        self.send_socket = socket(AF_INET, SOCK_DGRAM)
        self.send_socket.setblocking(0)
        self.send_socket.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)

        self.recv_socket = socket(AF_INET, SOCK_DGRAM)
        self.recv_socket.setblocking(0)
        if IS_BSD:
            self.recv_socket.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)  # requires sudo
        self.recv_socket.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)  # allows multiple UDPLinks to all listen for UDP packets
        self.recv_socket.bind(('', self.port))
bind to the datagram socket (UDP), and enable BROADCAST mode