The function allows the SDK to connect to the kavehost service in Unix-like operating systems. This service is started separately. For more information, see section "Organizing service mode in Linux".
This function is only supported on Linux platforms. Use the kaveInitializeEx function to start KAV SDK as a service on Windows platforms.
The application must call the kaveUninitialize function to disconnect from the service. The service itself must be stopped by administrators.
Scanner host types and options
The KAV scanner can be run as a separate process or from inside the application. The dwScannerHostType parameter defines the scanner host type; it is specified during SDK initialization. For detailed information about KAV SDK initializing flags, which can be specified in the dwScannerHostType parameter, refer to section "Initialization flags".
Syntax
HRESULT kaveInitializeService (
const char *pComConnString,
const char *pScanConnString,
const char *pEventConnString,
unsigned long dwOutprocScannersCount,
unsigned long dwScanningThreadsCount,
unsigned long dwQueueLength,
PFNCALLBACK pfnUserCallback,
long dwNetworkTimeout);
Parameters
The kaveInitializeService function has the following parameters.
kaveInitializeService function parameters
Name |
Type |
Description |
|---|---|---|
|
in |
A pointer to the first socket as specified in the If you are using local communications via UNIX domain sockets, this parameter must point to the For more information, see section "Kavehost service configuration file". |
|
in |
A pointer to the scanning socket as specified in the If you are using local communications via UNIX domain sockets, this parameter must point to the For more information, see section "Kavehost service configuration file". |
|
in |
A pointer to the event socket as specified in the If you are using local communications via UNIX domain sockets, this parameter must point to the For more information, see section "Kavehost service configuration file". |
|
in |
This parameter defines the number of kavehost scanning processes. If this parameter is set to The maximum permissible number of scanning processes is |
|
in |
This parameter defines the maximum number of scanning threads running simultaneously. If this parameter is set to This parameter defines the maximum number of scanning threads spawned by your client application that can be simultaneously handled by running scanning processes. The scanning threads are distributed between scanning processes, number of which is specified by the If The value specified in the < |
|
in |
The maximum length of the scanning task queue. The queue is used in asynchronous scanning. All the scanning processes take the scanning tasks from a single queue. If you set the To organize an infinite queue, set The length can be changed later by calling the |
|
in |
A pointer to the callback function. This function is called if one of the callback events occurs, for example, malware is detected, or an error occurs, or inquiry on disinfection is needed, or the user must be notified about scan completion, and so on. |
|
in |
The maximum time, in milliseconds, for the service to wait for connection from the client. After the specified timeout expires, connection is considered lost. This timeout is critical when connecting to the When working on Linux platform, it is recommended that you set this timeout to 1 minute or to a greater value, to compensate for the amount of time necessary for the |
Return value
If the kaveInitializeService function succeeds, its return value is S_OK.
For other return codes, see section "Return codes".
Page top