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.
Functional interface declaration of the NetworkEventCallback callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidrun(SocketClientEvent event, @Nullable IOStream connection) Emitted to indicate that some network-related event related tomsghas occurred.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(MemorySegment, int, MemorySegment)method.default voidupcall(MemorySegment sourceMessage, int event, MemorySegment connection) Theupcallmethod is called from native code.
-
Method Details
-
run
Emitted to indicate that some network-related event related to
msghas occurred.This essentially proxies the
Gio.SocketClient::eventsignal, but only for events that occur whilemsg"owns" the connection; ifmsgis 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 theMessageFlags.NEW_CONNECTIONflag on it.)See
Gio.SocketClient::eventfor more information on what the different values ofeventcorrespond to, and whatconnectionwill be in each case. -
upcall
Theupcallmethod is called from native code. The parameters are marshaled andrun(SocketClientEvent, IOStream)is executed. -
toCallback
Creates a native function pointer to theupcall(MemorySegment, int, MemorySegment)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-