This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
MathLink C Function


int MLReady(MLINK link)
tests whether there is data ready to be read from link.
  • Analogous to the Mathematica function LinkReadyQ.
  • MLReady() is often called in a loop as a way of polling a MathLink connection.
  • MLReady() will always return immediately, and will not block.
  • You must call MLFlush() before calling MLReady().
  • MLReady() returns 0 if the link has no data to read and a nonzero value if the link does have data.
  • MLReady() is declared in the MathLink header file mathlink.h.
#include "mathlink.h"

/* check a link for readable data */

void f(MLINK);
    if(! MLFlush(lp))
        { /* unable to flush any outgoing data buffered in lp */ }

        { /* read the data from the link */ }
        { /* data not ready to read */ }