Package org.gnome.gio
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.
Functional interface declaration of the
IncomingCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
run
(SocketConnection connection, @Nullable GObject sourceObject) The ::incoming signal is emitted when a new incoming connection toservice
needs to be handled.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 sourceSocketService, MemorySegment connection, MemorySegment sourceObject) Theupcall
method is called from native code.
-
Method Details
-
run
The ::incoming signal is emitted when a new incoming connection toservice
needs to be handled. The handler must initiate the handling ofconnection
, 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. -
upcall
default int upcall(MemorySegment sourceSocketService, 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
-