Interface Message.NetworkEventCallback

All Superinterfaces:
FunctionPointer
Enclosing class:
Message
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 Message.NetworkEventCallback extends FunctionPointer

Functional interface declaration of the NetworkEventCallback callback.

See Also:
  • Method Details

    • run

      void run(SocketClientEvent event, @Nullable IOStream connection)

      Emitted to indicate that some network-related event related to msg has occurred.

      This essentially proxies the Gio.SocketClient::event signal, but only for events that occur while msg "owns" the connection; if msg is sent on an existing persistent connection, then this signal will not be emitted. (If you want to force the message to be sent on a new connection, set the MessageFlags.NEW_CONNECTION flag on it.)

      See Gio.SocketClient::event for more information on what the different values of event correspond to, and what connection will be in each case.

    • upcall

      default void upcall(MemorySegment sourceMessage, int event, MemorySegment connection)
      The upcall method is called from native code. The parameters are marshaled and run(SocketClientEvent, IOStream) is executed.
    • toCallback

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