On datagram receive.

        :param data:
        :param addr:
        :return:

def datagram_received(self, data, addr):
        '''
        On datagram receive.

        :param data:
        :param addr:
        :return:
        '''
        message = salt.utils.stringutils.to_unicode(data)
        if message.startswith(self.signature):
            try:
                timestamp = float(message[len(self.signature):])
            except (TypeError, ValueError):
                self.log.debug(
                    'Received invalid timestamp in package from %s:%s',
                    *addr
                )
                if self.disable_hidden:
                    self._sendto('{0}:E:{1}'.format(self.signature, 'Invalid timestamp'), addr)
                return

            if datetime.datetime.fromtimestamp(timestamp) < (datetime.datetime.now() - datetime.timedelta(seconds=20)):
                if self.disable_hidden:
                    self._sendto('{0}:E:{1}'.format(self.signature, 'Timestamp is too old'), addr)
                self.log.debug('Received outdated package from %s:%s', *addr)
                return

            self.log.debug('Received "%s" from %s:%s', message, *addr)
            self._sendto(
                salt.utils.stringutils.to_bytes(str('{0}:@:{1}').format(  # future lint: disable=blacklisted-function
                    self.signature,
                    salt.utils.json.dumps(self.answer, _json_module=_json)
                )),
                addr
            )
        else:
            if self.disable_hidden:
                self._sendto(
                    salt.utils.stringutils.to_bytes(
                        '{0}:E:{1}'.format(self.signature, 'Invalid packet signature'),
                        addr
                    )
                )
            self.log.debug('Received bad signature from %s:%s', *addr)