PubSub+ Messaging API For C  7.29.0.6
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
solClient_context_createRegisterFdFuncInfo Struct Reference

Function information for file descriptor registration and file descriptor unregistration functions. More...

#include <solClient.h>

Data Fields

solClient_context_registerFdFunc_t regFdFunc_p
 
solClient_context_unregisterFdFunc_t unregFdFunc_p
 
void * user_p
 

Detailed Description

Function information for file descriptor registration and file descriptor unregistration functions.

This is set on a per-Context basis. Providing these functions is optional. If provided, both must be non-NULL, and if not provided, both must be NULL.

These functions are used when the application wants to own event generation, and they supply file descriptor events to the API. Such applications typically want to poll several different devices, of which the API is only one. When these functions are provided, the API does not manage its own devices. Instead, when a device is created, the provided 'register' function is called to register the device file descriptor for read and/or write events. It is the responsibility of the application to call back into API when the appropriate event occurs on the device file descriptor. The API callback is provided to the register function (see solClient_context_registerFdFunc_t). If this interface is chosen, the application must also call solClient_context_timerTick() at regular intervals.

Normally these are not used, and the API owns event registrations. If an internal Context thread is used by enabling SOLCLIENT_CONTEXT_PROP_CREATE_THREAD (see also SOLCLIENT_CONTEXT_PROPS_DEFAULT_WITH_CREATE_THREAD), the API takes care of all devices and timers and no action is required by the application. If the internal thread is not enabled, the application must call solClient_context_processEvents() to provide scheduling time to the API.

When the API owns event registrations, it also provides file descriptor register/unregister service to the application. solClient_context_registerForFdEvents() and solClient_context_unregisterForFdEvents() can be used by applications to pass file descriptors to the API for managing, keeping event generation localized to the internal thread or the thread that calls solClient_context_processEvents().

Field Documentation

void* user_p