Package ch.bailu.gtk.gio
Class InetAddress
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gio.InetAddress
- All Implemented Interfaces:
PointerInterface
#GInetAddress represents an IPv4 or IPv6 internet address. Use
g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
look up the #GInetAddress for a hostname. Use
g_resolver_lookup_by_address() or
g_resolver_lookup_by_address_async() to look up the hostname for a
#GInetAddress.
To actually connect to a remote host, you will need a
#GInetSocketAddress (which includes a #GInetAddress as well as a
port number).
g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
look up the #GInetAddress for a hostname. Use
g_resolver_lookup_by_address() or
g_resolver_lookup_by_address_async() to look up the hostname for a
#GInetAddress.
To actually connect to a remote host, you will need a
#GInetSocketAddress (which includes a #GInetAddress as well as a
port number).
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
equal
(InetAddress other_address) Checks if two #GInetAddress instances are equal, e.g. the same address.static ClassHandler
int
Gets @address's familystatic int
boolean
getIsAny()
Tests whether @address is the "any" address for its family.boolean
Tests whether @address is a link-local address (that is, if it
identifies a host on a local network that is not connected to the
Internet).boolean
Tests whether @address is the loopback address for its family.boolean
Tests whether @address is a global multicast address.boolean
Tests whether @address is a link-local multicast address.boolean
Tests whether @address is a node-local multicast address.boolean
Tests whether @address is an organization-local multicast address.boolean
Tests whether @address is a site-local multicast address.boolean
Tests whether @address is a multicast address.boolean
Tests whether @address is a site-local address such as 10.0.0.1
(that is, the address identifies a host on a local network that can
not be reached directly from the Internet, but which may have
outgoing Internet connectivity via a NAT or firewall).long
Gets the size of the native raw binary address for @address.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
static InetAddress
newAnyInetAddress
(int family) Creates a #GInetAddress for the "any" address (unassigned/"don't
care") for @family.static InetAddress
newFromStringInetAddress
(Str string) Parses @string as an IP address and creates a new #GInetAddress.static InetAddress
newFromStringInetAddress
(String string) Parses @string as an IP address and creates a new #GInetAddress.static InetAddress
newLoopbackInetAddress
(int family) Creates a #GInetAddress for the loopback address for @family.toStr()
Converts @address to string form.Methods inherited from class 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
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
InetAddress
-
-
Method Details
-
getClassHandler
-
newAnyInetAddress
Creates a #GInetAddress for the "any" address (unassigned/"don't
care") for @family.- Parameters:
family
- the address family- Returns:
- a new #GInetAddress corresponding to the "any" address for @family. Free the returned object with g_object_unref().
-
newFromStringInetAddress
Parses @string as an IP address and creates a new #GInetAddress.- Parameters:
string
- a string representation of an IP address- Returns:
- a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed. Free the returned object with g_object_unref().
-
newFromStringInetAddress
Parses @string as an IP address and creates a new #GInetAddress.- Parameters:
string
- a string representation of an IP address- Returns:
- a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed. Free the returned object with g_object_unref().
-
newLoopbackInetAddress
Creates a #GInetAddress for the loopback address for @family.- Parameters:
family
- the address family- Returns:
- a new #GInetAddress corresponding to the loopback address for @family. Free the returned object with g_object_unref().
-
equal
Checks if two #GInetAddress instances are equal, e.g. the same address.- Parameters:
other_address
- Another #GInetAddress.- Returns:
- %TRUE if @address and @other_address are equal, %FALSE otherwise.
-
getFamily
public int getFamily()Gets @address's family- Returns:
- @address's family
-
getIsAny
public boolean getIsAny()Tests whether @address is the "any" address for its family.- Returns:
- %TRUE if @address is the "any" address for its family.
-
getIsLinkLocal
public boolean getIsLinkLocal()Tests whether @address is a link-local address (that is, if it
identifies a host on a local network that is not connected to the
Internet).- Returns:
- %TRUE if @address is a link-local address.
-
getIsLoopback
public boolean getIsLoopback()Tests whether @address is the loopback address for its family.- Returns:
- %TRUE if @address is the loopback address for its family.
-
getIsMcGlobal
public boolean getIsMcGlobal()Tests whether @address is a global multicast address.- Returns:
- %TRUE if @address is a global multicast address.
-
getIsMcLinkLocal
public boolean getIsMcLinkLocal()Tests whether @address is a link-local multicast address.- Returns:
- %TRUE if @address is a link-local multicast address.
-
getIsMcNodeLocal
public boolean getIsMcNodeLocal()Tests whether @address is a node-local multicast address.- Returns:
- %TRUE if @address is a node-local multicast address.
-
getIsMcOrgLocal
public boolean getIsMcOrgLocal()Tests whether @address is an organization-local multicast address.- Returns:
- %TRUE if @address is an organization-local multicast address.
-
getIsMcSiteLocal
public boolean getIsMcSiteLocal()Tests whether @address is a site-local multicast address.- Returns:
- %TRUE if @address is a site-local multicast address.
-
getIsMulticast
public boolean getIsMulticast()Tests whether @address is a multicast address.- Returns:
- %TRUE if @address is a multicast address.
-
getIsSiteLocal
public boolean getIsSiteLocal()Tests whether @address is a site-local address such as 10.0.0.1
(that is, the address identifies a host on a local network that can
not be reached directly from the Internet, but which may have
outgoing Internet connectivity via a NAT or firewall).- Returns:
- %TRUE if @address is a site-local address.
-
getNativeSize
public long getNativeSize()Gets the size of the native raw binary address for @address. This
is the size of the data that you get from g_inet_address_to_bytes().- Returns:
- the number of bytes used for the native version of @address.
-
toStr
Converts @address to string form.- Returns:
- a representation of @address as a string, which should be freed after use.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-