OpenersNotesSection(Spacer1)Details

Sometimes it is useful to provide a form of identification to the other side of the link prior to sending any packet data. WSSetEnvIDString() sets the application's identification string and WSTP will exchange that string with any remote WSTP connection during (NonWLLink[WSActivate(), paclet:ref/c/WSActivate]) time.

WSSetEnvIDString() returns 0 in the event of an error, and a nonzero value if the function succeeds.

WSSetEnvIDString() is declared in the WSTP header file (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

int main()
{
	WSENV env;

	env = WSInitialize((WSEnvironmentParameter)0);
	if(env == (WSENV)0)
		{ /* unable to initialize the WSTP environment */ }

	if(! WSSetEnvIDString(env, "Your Company Inc. App 25"))
		{ /* unable to set app ID string */ }

	/* ... */	

	WSDeinitialize(env);
	return 0;
}

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

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

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}})}})