Using the additional server API for servers (pub.h)
The API allows servers to publish groups of endpoints. From the server perspective, a group of endpoints is a set of endpoints provided by the server and for which the server may receive client requests to create IPC channels using one DCM handle. A server can publish multiple groups of endpoints. A set of endpoints from different groups published by a server must not overlap.
Information about API functions is provided in the table below.
To publish a group of server-provided endpoints to DCM
, call the DcmPublishGroupEndpoints()
function. Use the endpoints
parameter of the DcmPublishGroupEndpoints()
function to define the qualified names and the contexts of grouped endpoints, and the names of endpoint interfaces. (The array of structures whose pointer is defined via the endpoints
parameter can be deleted after publication.) An endpoint context is the data that is used by the server to determine which specific endpoint from the published group is required by the client when the DcmListenGroupPub()
function is called. You can use a numerical identifier or a pointer to specific data as the endpoint context. A DcmPublishGroupEndpoints()
function call creates a DCM handle that enables receipt of client requests to create IPC channels to use endpoints in the specific group with specific interfaces.
To receive a client request to create an IPC channel to use an endpoint in the published group, call the DcmListenGroupPub()
function. In the pubHandle
parameter of the DcmListenGroupPub()
function, specify the DCM handle that was obtained by calling the DcmPublishGroupEndpoints()
function. The output outContext
of the DcmListenGroupPub()
function contains the pointer to the endpoint context. The DcmListenGroupPub()
function call creates a DCM handle that enables acceptance or rejection of a client request to create an IPC channel to use the specific endpoint in the group that matches the received endpoint context.
To unpublish a group of endpoints, call the DcmCloseGroupPubHandle()
function to close the DCM handle that was created when the endpoint was published. If a server terminates, all published groups of server endpoints will also be unpublished.
To interrupt a blocking call of the DcmListenGroupPub()
function from another thread, call the DcmInterruptGroupPubBlockingCall()
function.
You can use the DcmSubscribeToGroupPubEvent()
and DcmUnsubscribeFromGroupPubEvent()
functions together with the functions from the notice_api.h API to receive notifications about the occurrence of the following events: the server received a request from the client to create an IPC channel (the DCM_CLIENT_CONNECTED
flag), or a blocking call of the DcmListenGroupPub()
function was interrupted (the DCM_BLOCKING_CALL_INTERRUPTED
flag). (Flags of the event mask and the "resource–event mask" entry ID DCM_EVENT_ID
are defined in the header file sysroot-*-kos/include/dcm/dcm_api.h
from the KasperskyOS SDK.) The DcmSubscribeToGroupPubEvent()
and DcmUnsubscribeFromGroupPubEvent()
functions let you configure the notification receiver by adding or deleting, respectively, tracked objects identified by DCM handles.
pub.h functions
Function |
Information about the function |
---|---|
|
Purpose Publishes a group of endpoints to Parameters
Returned values If successful, the function returns |
|
Purpose Receives a client request to create an IPC channel Parameters
Returned values If successful, the function returns If a blocking call was interrupted by calling the Additional information Non-blocking call if the |
|
Purpose Interrupts a blocking call of the Parameters
Returned values If successful, the function returns |
|
Purpose Closes the DCM handle that was received by calling the Parameters
Returned values If successful, the function returns |
|
Purpose Configures the notification receiver to receive notifications about events related to the object identified by the defined DCM handle. Parameters
Returned values If successful, the function returns |
|
Purpose Configures the notification receiver to not receive notifications about events related to the object identified by the defined DCM handle. Parameters
Returned values If successful, the function returns |