SLPError SLPOpen(const char* lang,
SLPBoolean
isasync,
SLPHandle*
phslp)
An SLPHandle can only be used for one SLP API operation at a time. If the original operation was started asynchronously, any attempt to start an additional operation on the handle while the original operation is pending results in the return of an SLP_HANDLE_IN_USE error from the API function. The SLPClose() API function terminates any outstanding calls on the handle. If an implementation is unable to support a asynchronous( resp. synchronous) operation, due to memory constraints or lack of threading support, the SLP_NOT_IMPLEMENTED flag may be returned when the isasync flag is SLP_TRUE (resp. SLP_FALSE).
In the OpenSLP implementation, SLPHandles are used to cache information that is costly to obtain (in terms of network usage and time). Since the RFC 2614 API does not specify functions to initialize the implementation library, OpenSLP keeps track of the number of SLPHandles that are open. Several global library data structures are initialized when the first SLPHandle is opened and maintained until the last SLPHandle is closed. Therefore, it is most efficient to leave SLPHandles open for as long as you will need them (often for the entire life of a process). If you can help it, DO NOT make a habit of opening and closing SLPHandles frequently.
SLP_AUTHENTICATION_FAILED | If the SLP framework supports authentication, this error arises when a authentication on an SLP message failed. |
SLP_MEMORY_ALLOC_FAILED | Out of memory error |
SLP_PARAMETER_BAD | If a parameter passed into a function is bad, this error is returned. |
SLP_INTERNAL_SYSTEM_ERROR | A basic failure of the API causes this error to be returned. This occurs when a system call or library fails. The operation could not recover. |
SLP_HANDLE_IN_USE | Callback functions are not permitted to recursively call into the API on the same SLPHandle, either directly or indirectly. If an attempt is made to do so, this error is returned from the called API function. |
Be aware, especially if the call is async, of error codes that may be
passed to the SLPRegReport() callback function.
OpenSLP 0.6.0 | Fully implemented as specified by RFC 2614 |