Class NativeSocketAddress

All Implemented Interfaces:
SocketConnectable, Proxy

@Generated("org.javagi.JavaGI") public class NativeSocketAddress extends SocketAddress implements SocketConnectable

A socket address of some unknown native type.

This corresponds to a general struct sockaddr of a type not otherwise handled by GLib.

Since:
2.46
  • Constructor Details

    • NativeSocketAddress

      public NativeSocketAddress(MemorySegment address)
      Create a NativeSocketAddress instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • NativeSocketAddress

      public NativeSocketAddress(@Nullable MemorySegment native_, long len)
      Creates a new GNativeSocketAddress for native_ and len.
      Parameters:
      native_ - a native address object
      len - the length of native, in bytes
      Since:
      2.46
    • NativeSocketAddress

      public NativeSocketAddress()
      Create a new NativeSocketAddress.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the NativeSocketAddress class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected NativeSocketAddress asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class SocketAddress
      Returns:
      the instance as if it were its parent type
    • builder

      public static NativeSocketAddress.Builder<? extends NativeSocketAddress.Builder> builder()
      A NativeSocketAddress.Builder object constructs a NativeSocketAddress with the specified properties. Use the various set...() methods to set properties, and finish construction with NativeSocketAddress.Builder.build().
      Returns:
      the builder object