Interface SocketService.IncomingCallback

All Superinterfaces:
FunctionPointer
Enclosing class:
SocketService
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface SocketService.IncomingCallback extends FunctionPointer

Functional interface declaration of the IncomingCallback callback.

Since:
2.22
See Also:
  • Method Details

    • run

      boolean run(@Nullable SocketConnection connection, @Nullable GObject sourceObject)

      The ::incoming signal is emitted when a new incoming connection to service needs to be handled. The handler must initiate the handling of connection, but may not block; in essence, asynchronous operations must be used.

      connection will be unreffed once the signal handler returns, so you need to ref it yourself if you are planning to use it.

      Since:
      2.22
    • upcall

      default int upcall(MemorySegment sourceSocketService, MemorySegment connection, MemorySegment sourceObject)
      The upcall method is called from native code. The parameters are marshaled and run(SocketConnection, GObject) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, MemorySegment, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer