def send(self, data, dst=None):
    '\n        Send data through the socket.\n\n        :param bytes data: Data to send.\n        '
    if dst:
        (dst_addr, dst_port) = dst
        if isinstance(dst_addr, str):
            dst_addr = haddr_parse_interface(dst_addr)
        addr_type = struct.pack('B', dst_addr.TYPE)
        packed_dst = (dst_addr.pack() + struct.pack('!H', dst_port))
    else:
        addr_type = struct.pack('B', AddrType.NONE)
        packed_dst = b''
    data_len = struct.pack('!I', len(data))
    data = b''.join([self.COOKIE, addr_type, data_len, packed_dst, data])
    try:
        self.sock.sendall(data)
        return True
    except OSError as e:
        logging.error('error in send: %s', e)
        return False
Send data through the socket.

:param bytes data: Data to send.
def send(self, data, dst=None):
    '\n        Send data through the socket.\n\n        :param bytes data: Data to send.\n        '
    if dst:
        (dst_addr, dst_port) = dst
        if isinstance(dst_addr, str):
            dst_addr = haddr_parse_interface(dst_addr)
        addr_type = struct.pack('B', dst_addr.TYPE)
        packed_dst = (dst_addr.pack() + struct.pack('!H', dst_port))
    else:
        addr_type = struct.pack('B', AddrType.NONE)
        packed_dst = b
    data_len = struct.pack('!I', len(data))
    data = b.join([self.COOKIE, addr_type, data_len, packed_dst, data])
    try:
        self.sock.sendall(data)
        return True
    except OSError as e:
        logging.error('error in send: %s', e)
        return False