WSServiceRef (C Function)

is a WSTP type that contains a reference to a service discovery browse operation, service resolve operation, or service registration operation.



Basic Examples  (1)

#include "wstp.h"

void BrowseCallbackFunction(WSENV env, WSServiceRef ref, int flag, const char *name, void *context);

WSServiceRef browseForServices(WSENV e)
    int apiResult = 0;
    WSServiceRef ref;

    apiResult = WSBrowseForLinkServices(e, BrowseCallbackFunction, NULL /* Use the default browse domain */, NULL /* do not use a context object this time */, &ref);
    if(apiResult != 0)
    { /* Handle the error */

    return ref;