MLWaitForLinkActivity (C Function)

MLWaitForLinkActivity has been replaced by WSWaitForLinkActivity.

int MLWaitForLinkActivity(MLINK l)

does not return until the MathLink connection specified by l has data to read.

Details

  • Use MLWaitForLinkActivity() 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 MLWaitForLinkActivity() (or the related function MLWaitForLinkActivityWithCallback()) when needing to wait for link activity on a link that is enabled for logging().
  • MLWaitForLinkActivity() returns MLWAITERROR in the event of an error and MLWAITSUCCESS if the function succeeds.
  • MLWaitForLinkActivity() is declared in the MathLink header file mathlink.h.

Examples

Basic Examples  (1)

#include "mathlink.h"

/* A function for waiting on link activity */

void f(MLINK l)
{
    switch(MLWaitForLinkActivity(l))
    {
        case MLWAITERROR:
            /* Handle the error */
            break;
        case MLWAITSUCCESS:
        default:
            /* Do something else */
    }
}