• Dan Winship's avatar
    gnetworkaddress: Add g_network_address_new_loopback() constructor · 64f9bf96
    Dan Winship authored
    This is a convenience method for creating a GNetworkAddress which is
    guaranteed to return IPv4 and IPv6 loopback addresses. The program
    cannot guarantee that 'localhost' will resolve to both types of
    address, so programs which wish to connect to a local service over
    either IPv4 or IPv6 must currently manually create an IPv4 and another
    IPv6 socket, and detect which of the two are working. This new API
    allows the existing GSocketConnectable machinery to be used to
    automate that.
    
    Based on a patch from Philip Withnall.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732317
    64f9bf96
gnetworkaddress.h 2.88 KB