NetworkAddress.parseUri

gio.network_address.NetworkAddress parseUri(string uri, ushort defaultPort)

Creates a new #GSocketConnectable for connecting to the given uri. May fail and return null in case parsing uri fails.

Using this rather than [gio.network_address.NetworkAddress.new_] or [gio.network_address.NetworkAddress.parse] allows #GSocketClient to determine when to use application-specific proxy protocols.

Parameters

urithe hostname and optionally a port
defaultPortThe default port if none is found in the URI

Returns

the new

#GNetworkAddress, or null on error

Throws

[ErrorWrap]