gnetworkaddress: Add g_network_address_new_loopback() constructor
authorDan Winship <danw@gnome.org>
Sun, 23 Nov 2014 17:53:03 +0000 (12:53 -0500)
committerDan Winship <danw@gnome.org>
Sat, 29 Nov 2014 19:22:42 +0000 (14:22 -0500)
commit64f9bf96fdc47ab7fedd91d291f805c3e10322b4
treec71cb91c3da9f5ed759d33c5785b1e985efbc636
parent296c710c64c3f145674a6c20357d4c0b0da1b393
gnetworkaddress: Add g_network_address_new_loopback() constructor

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
docs/reference/gio/gio-sections.txt
gio/gnetworkaddress.c
gio/gnetworkaddress.h
gio/tests/network-address.c