Gio.InetSocketAddress.new_from_string

function new_from_string(address: String, port: Number(guint)): Gio.SocketAddress {
    // Gjs wrapper for g_inet_socket_address_new_from_string()
}
  

Creates a new Gio.InetSocketAddress for address and port.

If address is an IPv6 address, it can also contain a scope ID (separated from the address by a "<literal>%</literal>").

Since 2.40

address

the string form of an IP address

port

a port number

Returns

a new Gio.InetSocketAddress, or null if address cannot be parsed.