OpenersNotesSection(Spacer1)Details

If WSPortFromLinkServer() succeeds err will contain 0.  If WSPortFromLinkServer() failes, err will contain a nonzero error code.

The nonzero values that indicate an error condition correspond to the WSE error codes in (RefLink[wstp.h, paclet:ref/file/wstp.h]) and as returned by (NonWLLink[WSError(), paclet:/ref/c/WSError]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

unsigned short getPortFromLinkServer(WSLinkServer server)
{
	return WSPortFromLinkServer(server);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSNewLinkServer(), paclet:ref/c/WSNewLinkServer])  ▪  (NonWLLink[WSNewLinkServerWithPort(), paclet:ref/c/WSNewLinkServerWithPort])  ▪  (NonWLLink[ WSNewLinkServerWithPortAndInterface(), paclet:ref/c/WSNewLinkServerWithPortAndInterface])  ▪  (NonWLLink[WSShutdownLinkServer(), paclet:ref/c/WSShutdownLinkServer])  ▪  (NonWLLink[WSRegisterCallbackFunctionWithLinkServer(), paclet:ref/c/WSRegisterCallbackFunctionWithLinkServer])  ▪  (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])}})}})