Klasse InetAddress

Alle implementierten Schnittstellen:
PointerInterface

public class InetAddress extends PropertyHolder
`GInetAddress` represents an IPv4 or IPv6 internet address. Use
[method@Gio.Resolver.lookup_by_name] or
[method@Gio.Resolver.lookup_by_name_async] to look up the `GInetAddress` for
a hostname. Use [method@Gio.Resolver.lookup_by_address] or
[method@Gio.Resolver.lookup_by_address_async] to look up the hostname for a
`GInetAddress`.

To actually connect to a remote host, you will need a
[class@Gio.InetSocketAddress] (which includes a `GInetAddress` as well as a
port number).

https://docs.gtk.org/gio/class.InetAddress.html

  • Konstruktordetails

  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • newAnyInetAddress

      public static InetAddress newAnyInetAddress(int family)
      Creates a #GInetAddress for the "any" address (unassigned/"don't
      care") for @family.
      Parameter:
      family - the address family
      Gibt zurück:
      a new #GInetAddress corresponding to the "any" address for @family. Free the returned object with g_object_unref().
    • newFromStringInetAddress

      public static InetAddress newFromStringInetAddress(@Nonnull Str string)
      Parses @string as an IP address and creates a new #GInetAddress.
      Parameter:
      string - a string representation of an IP address
      Gibt zurück:
      a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed. Free the returned object with g_object_unref().
    • newFromStringInetAddress

      public static InetAddress newFromStringInetAddress(String string)
      Parses @string as an IP address and creates a new #GInetAddress.
      Parameter:
      string - a string representation of an IP address
      Gibt zurück:
      a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed. Free the returned object with g_object_unref().
    • newLoopbackInetAddress

      public static InetAddress newLoopbackInetAddress(int family)
      Creates a #GInetAddress for the loopback address for @family.
      Parameter:
      family - the address family
      Gibt zurück:
      a new #GInetAddress corresponding to the loopback address for @family. Free the returned object with g_object_unref().
    • equal

      public boolean equal(@Nonnull InetAddress other_address)
      Checks if two #GInetAddress instances are equal, e.g. the same address.
      Parameter:
      other_address - Another #GInetAddress.
      Gibt zurück:
      %TRUE if @address and @other_address are equal, %FALSE otherwise.
    • getFamily

      public int getFamily()
      Gets @address's family
      Gibt zurück:
      @address's family
    • getIsAny

      public boolean getIsAny()
      Tests whether @address is the "any" address for its family.
      Gibt zurück:
      %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).
      Gibt zurück:
      %TRUE if @address is a link-local address.
    • getIsLoopback

      public boolean getIsLoopback()
      Tests whether @address is the loopback address for its family.
      Gibt zurück:
      %TRUE if @address is the loopback address for its family.
    • getIsMcGlobal

      public boolean getIsMcGlobal()
      Tests whether @address is a global multicast address.
      Gibt zurück:
      %TRUE if @address is a global multicast address.
    • getIsMcLinkLocal

      public boolean getIsMcLinkLocal()
      Tests whether @address is a link-local multicast address.
      Gibt zurück:
      %TRUE if @address is a link-local multicast address.
    • getIsMcNodeLocal

      public boolean getIsMcNodeLocal()
      Tests whether @address is a node-local multicast address.
      Gibt zurück:
      %TRUE if @address is a node-local multicast address.
    • getIsMcOrgLocal

      public boolean getIsMcOrgLocal()
      Tests whether @address is an organization-local multicast address.
      Gibt zurück:
      %TRUE if @address is an organization-local multicast address.
    • getIsMcSiteLocal

      public boolean getIsMcSiteLocal()
      Tests whether @address is a site-local multicast address.
      Gibt zurück:
      %TRUE if @address is a site-local multicast address.
    • getIsMulticast

      public boolean getIsMulticast()
      Tests whether @address is a multicast address.
      Gibt zurück:
      %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).
      Gibt zurück:
      %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().
      Gibt zurück:
      the number of bytes used for the native version of @address.
    • toStr

      public Str toStr()
      Converts @address to string form.
      Gibt zurück:
      a representation of @address as a string, which should be freed after use.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()