def METHOD_NAME(ql: Qiling, address: int, params):
    name = params["name"]
    namelen = params['namelen']
    # sockaddr structure type needs to be defined based on the family field value.
    # both types (for ipv4 and ipv6) have it on the same offset, so we assume ipv4
    # by default for convinience.
    sockaddr_struct = make_sockaddr_in()
    # sockaddr is not based on BaseStruct, so we have to read it manually
    sockaddr_data = ql.mem.read(name, namelen)
    sockaddr_obj = sockaddr_struct.from_buffer_copy(sockaddr_data[:ctypes.sizeof(sockaddr_struct)])
    sin_family = sockaddr_obj.sin_family
    sin_port = sockaddr_obj.sin_port
    if sin_family == 0x17:  # IPv6
        sockaddr_struct = make_sockaddr_in6()
        sockaddr_obj = sockaddr_struct.from_buffer_copy(sockaddr_data[:ctypes.sizeof(sockaddr_struct)])
        # read address bytes and show them as pairs
        segments = [f'{b:02x}' for b in sockaddr_obj.sin6_addr.Byte]
        sin_addr = ':'.join(''.join(x) for x in zip(segments[0::2], segments[1::2]))
    elif sin_family == 0x2:  # IPv4
        a = sockaddr_obj.sin_addr
        sin_addr = '.'.join((a.s_b1, a.s_b2, a.s_b3, a.s_b4))
    else:
        ql.log.debug("sockaddr sin_family unhandled variant")
        return 0
    ql.log.debug(f'{sockaddr_struct.__name__} @ {name:#010x} : {sin_family=:#04x}, {sin_port=}, {sin_addr=}')
    # FIXME: wait.. we just printed stuff out, and did not connect anywhere..
    return 0