WSStopBrowsingForLinkServices (C Function)
void WSStopBrowsingForLinkServices(WSENV e,WSServiceRef r)
terminates the WSTP network link service browse operation referred to by r.
Details
- Browsing for link services is fundamentally an asynchronous operation. Call WSBrowseForLinkServices() to start the browse operation. The WSTP library will make callbacks to a provided callback function as network browsing events occur. WSBrowseForLinkServices() does not wait for a browse operation to complete. It returns to the caller immediately after starting the browse operation.
- The network browse operation will continue to run until the program calls WSStopBrowsingForLinkServices() or an error occurs with the operating system's service browsing mechanism.
- If the browse callback function registered with WSBrowseForLinkServices() receives the error flag WSSDBROWSEERROR, call WSStopBrowsingForLinkServices() to stop the browse operation.
- Once a program has called WSStopBrowsingForLinkServices(), it should then invalidate or delete any cached service names.
- The reference object r must be the same object returned by WSBrowseForLinkServices().
Examples
Basic Examples (1)
#include "wstp.h"
void BrowseCallbackFunction(WSENV e, WSServiceRef ref, const char *serviceName, void *context);
void manageBrowseOperation(WSENV e)
{
WSServiceResult theRef;
int apiResult = 0;
apiResult = WSBrowseForLinkServices(e, BrowseCallbackFunction, NULL /* Use the default browse domain */, NULL /* do not use a context object in this example */, &theRef);
if(apiResult != 0)
{ /* Handle the error */ }
/* ... */
WSStopBrowsingForLinkServices(e, theRef);
}
void BrowseCallbackFunction(WSENV e, WSServiceRef ref, const char *serviceName, void *context)
{
...
}