def indication(self, pdu):
        if _debug: MiddleMan._debug('indication %r', pdu)

        if not pdu.pduData:
            stop()
            return

        # decode the line and trim off the eol
        line = pdu.pduData.decode('utf_8')[:-1]
        if _debug: MiddleMan._debug('    - line: %r', line)

        line_parts = line.split(' ', 1)
        if _debug: MiddleMan._debug('    - line_parts: %r', line_parts)
        if len(line_parts) != 2:
            sys.stderr.write("err: invalid line: %r\n" % (line,))
            return

        addr, msg = line_parts

        # check the address
        if addr == "*":
            dest = local_broadcast_tuple
        elif ':' in addr:
            addr, port = addr.split(':')
            if addr == "*":
                dest = (local_broadcast_tuple[0], int(port))
            else:
                dest = (addr, int(port))
        else:
            dest = (addr, local_unicast_tuple[1])
        if _debug: MiddleMan._debug('    - dest: %r', dest)

        # send it along
        try:
            self.request(PDU(msg.encode('utf_8'), destination=dest))
        except Exception as err:
            sys.stderr.write("err: %r\n" % (err,))
            return
dataset/ETHPy150Open JoelBender/bacpypes/samples/UDPConsole.py/MiddleMan.indication/original