OpenersNotesSection(Spacer1)Details

Resolving the connection details to a link service available on the network is fundamentally an asynchronous operation. Call (NonWLLink[WSResolveLinkService(), paclet:ref/c/WSResolveLinkService]) to start the resolve operation. The WSTP library will make callbacks to a provided callback function as connection details become available.

The network resolve operation will continue to run until the program calls WSStopResolvingLinkService() or an error occurs with the operating system's service browsing mechanism.

The reference object r must be the same object returned by (NonWLLink[WSResolveLinkService(), paclet:ref/c/WSResolveLinkService]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

void ResolveCallbackFunction(WSENV e, WSServiceRef r, const char *serviceName, const char *linkName, const char *protocol, int options, void *context);

void managerResolveOperations(WSENV e, const char *name)
{
	WSServiceRef theRef;
	int apiResult;

	apiResult = WSResolveLinkService(e, ResolveCallbackFunction, name,
		NULL /* No context object for this example */, &theRef);
	if(apiResult != 0)
	{ /* Handle the error */ }

	...

	WSStopResolvingLinkService(e, theRef);
}


void ResolveCallbackFunction(WSENV e, WSServiceRef r, const char *serviceName, const char *linkName, const char *protocol, int options, void *context)
{
	...
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSResolveLinkService(), paclet:ref/c/WSResolveLinkService])  ▪  (NonWLLink[WSResolveCallbackFunction, paclet:ref/c/WSResolveCallbackFunction])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})