Package org.gnome.gio
Interface ThreadedSocketService.RunCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
ThreadedSocketService
- 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 ThreadedSocketService.RunCallback
extends FunctionPointer
Functional interface declaration of the
RunCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
run
(SocketConnection connection, @Nullable GObject sourceObject) The ::run signal is emitted in a worker thread in response to an incoming connection.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default int
upcall
(MemorySegment sourceThreadedSocketService, MemorySegment connection, MemorySegment sourceObject) Theupcall
method is called from native code.
-
Method Details
-
run
The ::run signal is emitted in a worker thread in response to an incoming connection. This thread is dedicated to handlingconnection
and may perform blocking IO. The signal handler need not return until the connection is closed. -
upcall
default int upcall(MemorySegment sourceThreadedSocketService, MemorySegment connection, MemorySegment sourceObject) Theupcall
method is called from native code. The parameters are marshaled andrun(org.gnome.gio.SocketConnection, org.gnome.gobject.GObject)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-