WSPutMessage (C Function)

int WSPutMessage(WSLINK link,int msg)

sends the message msg to the link object link.


  • WSTP messages provide out-of-band message sending and receiving that is not tied to the normal transfer of data.
  • WSPutMessage() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSPutMessage() fails.
  • WSPutMessage() is declared in the WSTP header file wstp.h.


Basic Examples  (1)

#include "wstp.h"

/* send an abort message to a link */

void f(WSLINK lp)
    if(! WSPutMessage(lp, WSAbortMessage))
        { /* unable to send message to lp */ }