OpenersNotesSection(Spacer1)Details

In the normal course of using the Wolfram Symbolic Transfer Protocol, connections made between processes function on a one-to-one standard, meaning that when program A connects to program B, only A and B can use the communication endpoints established between A and B.   This one-to-one model differs from a traditional client/server communication model where a server advertises a connection in a one-to-many mode where the server has one connection and many clients connect to that one connection.   The WSTP link server functionality allows the user to create a program that offers a one-to-many connection using the Wolfram Symbolic Transfer Protocol.

You can think of WSShutdownLinkServer() as doing (NonWLLink[WSClose(), paclet:/ref/c/WSClose]) on the server end of the link.

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

void operateLinkServer(WSENV env)
{
	int error;
	WSLinkServer linkServer;
	WSLINK theLink;


	linkServer = WSNewLinkServer(env, NULL /* No context object for
		this example */, &error);
	if(error != WSEOK)
	{ /* Handle error */ }

	theLink = WSWaitForNewLinkFromLinkserver(linkServer, &error);
	if(theLink == (WSLINK)0 || error != WSEOK)
	{ /* Handle error */ }

	...

	WSCLose(theLink);

	WSShutdownLinkServer(linkServer);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSNewLinkServerWithPort(), paclet:ref/c/WSNewLinkServerWithPort])  ▪  (NonWLLink[ WSNewLinkServerWithPort(), paclet:ref/c/WSNewLinkServerWithPort])  ▪  (NonWLLink[WSNewLinkServerWithPortAndInterface(), paclet:ref/c/WSNewLinkServerWithPortAndInterface])  ▪  (NonWLLink[WSRegisterCallbackFunctionWithLinkServer(), paclet:ref/c/WSRegisterCallbackFunctionWithLinkServer])  ▪  (NonWLLink[WSWaitForNewLinkFromLinkServer(), paclet:ref/c/WSWaitForNewLinkFromLinkServer])  ▪  (NonWLLink[WSPortFromLinkServer(), paclet:ref/c/WSPortFromLinkServer])  ▪  (NonWLLink[WSInterfaceFromLinkServer(), paclet:ref/c/WSInterfaceFromLinkServer])  ▪  (NonWLLink[WSContextFromLinkServer(), paclet:ref/c/WSContextFromLinkServer])  ▪  (NonWLLink[WSReleaseInterfaceFromLinkServer(), paclet:ref/c/WSReleaseInterfaceFromLinkServer])}})}})

({{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])}})}})