attach


Description:

public uint attach (MainContext? context)

Attaches this to context.

When the mainloop for context is run, the server will be dispatched. When context is null, the default context will be used).

This function should be called when the server properties and urls are fully configured and the server is ready to start.

This takes a reference on this until the source is destroyed. Note that if context is not the default main context as returned by @default (or null), remove cannot be used to destroy the source. In that case it is recommended to use create_source and attach it to context manually.

Parameters:

this

a Server

context

a MainContext

Returns:

the ID (greater than 0) for the source within the GMainContext.




2022 vala-language.org