Package ch.bailu.gtk.gio
Klasse NetworkAddress
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gio.NetworkAddress
- Alle implementierten Schnittstellen:
PointerInterface
`GNetworkAddress` provides an easy way to resolve a hostname and
then attempt to connect to that host, handling the possibility of
multiple IP addresses and multiple address families.
The enumeration results of resolved addresses *may* be cached as long
as this object is kept alive which may have unexpected results if
alive for too long.
See [iface@Gio.SocketConnectable] for an example of using the connectable
interface.
then attempt to connect to that host, handling the possibility of
multiple IP addresses and multiple address families.
The enumeration results of resolved addresses *may* be cached as long
as this object is kept alive which may have unexpected results if
alive for too long.
See [iface@Gio.SocketConnectable] for an example of using the connectable
interface.
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungNetworkAddress
(PointerContainer pointer) NetworkAddress
(Str hostname, int port) Creates a new #GSocketConnectable for connecting to the given
@hostname and @port.NetworkAddress
(String hostname, int port) Creates a new #GSocketConnectable for connecting to the given
@hostname and @port. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungImplements interfaceSocketConnectable
.static ClassHandler
Gets @addr's hostname.static int
static long
static TypeSystem.TypeSize
int
getPort()
Gets @addr's port numberGets @addr's schemestatic long
static TypeSystem.TypeSize
static NetworkAddress
newLoopbackNetworkAddress
(int port) Creates a new #GSocketConnectable for connecting to the local host
over a loopback connection to the given @port.static NetworkAddress
Creates a new #GSocketConnectable for connecting to the given
@hostname and @port.static NetworkAddress
Creates a new #GSocketConnectable for connecting to the given
@uri.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
NetworkAddress
-
NetworkAddress
Creates a new #GSocketConnectable for connecting to the given
@hostname and @port.
Note that depending on the configuration of the machine, a
@hostname of `localhost` may refer to the IPv4 loopback address
only, or to both IPv4 and IPv6; use
g_network_address_new_loopback() to create a #GNetworkAddress that
is guaranteed to resolve to both addresses.- Parameter:
hostname
- the hostnameport
- the port
-
NetworkAddress
Creates a new #GSocketConnectable for connecting to the given
@hostname and @port.
Note that depending on the configuration of the machine, a
@hostname of `localhost` may refer to the IPv4 loopback address
only, or to both IPv4 and IPv6; use
g_network_address_new_loopback() to create a #GNetworkAddress that
is guaranteed to resolve to both addresses.- Parameter:
hostname
- the hostnameport
- the port
-
-
Methodendetails
-
getClassHandler
-
newLoopbackNetworkAddress
Creates a new #GSocketConnectable for connecting to the local host
over a loopback connection to the given @port. This is intended for
use in connecting to local services which may be running on IPv4 or
IPv6.
The connectable will return IPv4 and IPv6 loopback addresses,
regardless of how the host resolves `localhost`. By contrast,
g_network_address_new() will often only return an IPv4 address when
resolving `localhost`, and an IPv6 address for `localhost6`.
g_network_address_get_hostname() will always return `localhost` for
a #GNetworkAddress created with this constructor.- Parameter:
port
- the port- Gibt zurück:
- the new #GNetworkAddress
-
getHostname
Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
depending on what @addr was created with.- Gibt zurück:
- @addr's hostname
-
getPort
public int getPort()Gets @addr's port number- Gibt zurück:
- @addr's port (which may be 0)
-
getScheme
Gets @addr's scheme- Gibt zurück:
- @addr's scheme (%NULL if not built from URI)
-
parse
public static NetworkAddress parse(@Nonnull Str host_and_port, int default_port) throws AllocationError Creates a new #GSocketConnectable for connecting to the given
@hostname and @port. May fail and return %NULL in case
parsing @host_and_port fails.
@host_and_port may be in any of a number of recognised formats; an IPv6
address, an IPv4 address, or a domain name (in which case a DNS
lookup is performed). Quoting with [] is supported for all address
types. A port override may be specified in the usual way with a
colon.
If no port is specified in @host_and_port then @default_port will be
used as the port number to connect to.
In general, @host_and_port is expected to be provided by the user
(allowing them to give the hostname, and a port override if necessary)
and @default_port is expected to be provided by the application.
(The port component of @host_and_port can also be specified as a
service name rather than as a numeric port, but this functionality
is deprecated, because it depends on the contents of /etc/services,
which is generally quite sparse on platforms other than Linux.)- Parameter:
host_and_port
- the hostname and optionally a portdefault_port
- the default port if not in @host_and_port- Gibt zurück:
- the new #GNetworkAddress, or %NULL on error
- Löst aus:
AllocationError
-
parseUri
Creates a new #GSocketConnectable for connecting to the given
@uri. May fail and return %NULL in case parsing @uri fails.
Using this rather than g_network_address_new() or
g_network_address_parse() allows #GSocketClient to determine
when to use application-specific proxy protocols.- Parameter:
uri
- the hostname and optionally a portdefault_port
- The default port if none is found in the URI- Gibt zurück:
- the new #GNetworkAddress, or %NULL on error
- Löst aus:
AllocationError
-
asSocketConnectable
Implements interfaceSocketConnectable
. Call this to get access to interface functions.- Gibt zurück:
SocketConnectable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-