WSWaitForLinkActivity()
This feature is not supported on the Wolfram Cloud.

int WSWaitForLinkActivity(WSLINK l)
does not return until the WSTP connection specified by l has data to read.

DetailsDetails

  • Use WSWaitForLinkActivity() on a background thread that needs to wait for data in order not to block any user interface or main threads of the application.
  • Use WSWaitForLinkActivity() (or the related function WSWaitForLinkActivityWithCallback()) when needing to wait for link activity on a link that is enabled for logging().
  • WSWaitForLinkActivity() returns WSWAITERROR in the event of an error and WSWAITSUCCESS if the function succeeds.
  • WSWaitForLinkActivity() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

/* A function for waiting on link activity */

void f(WSINK l)
{
    switch(WSWaitForLinkActivity(l))
    {
        case WSWAITERROR:
            /* Handle the error */
            break;
        case WSWAITSUCCESS:
        default:
            /* Do something else */
    }
}
Introduced in 2014
(10.0)