OpenersNotesSection(Spacer1)Details

WSGetMessage() returns a nonzero value if it reads an out-of-band message and 0 otherwise.

WSGetMessage() is a nonblocking function.

WSGetMessage() can return the following messages:

WSFirstUserMessage should be used as the starting value for any user-defined messages. You could define a new message as #define MyAppMessage WSFirstUserMessage + 1.

User-defined messages should not have values larger than WSLastUserMessage.

Standard WSTP messages do not have any parameters.

WSGetMessage() 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"

/* read an out-of-band message code from a link */

void f(WSLINK lp)
{
	int code, param;

	if(WSMessageReady(lp))
	{
		if(! WSGetMessage(lp, &code, &param))
			{ /* unable to read the message code from lp */ }
	}
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSPutMessage(), paclet:ref/c/WSPutMessage])  ▪  (NonWLLink[WSPutMessageWithArg(), paclet:ref/c/WSPutMessageWithArg])  ▪  (NonWLLink[WSMessageReady(), paclet:ref/c/WSMessageReady])  ▪  (NonWLLink[WSSetMessageHandler(), paclet:ref/c/WSSetMessageHandler])  ▪  (NonWLLink[WSMessageHandlerObject(), paclet:ref/c/WSMessageHandlerObject])}})}})

({{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])}, {▪(RefLinkPlain[Low-Level WSTP Operations, paclet:guide/LowLevelWSTPOperations])}})}})