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

void WSClose(WSLINK link)
closes a WSTP connection.

DetailsDetails

  • Calling WSClose() does not necessarily terminate a program at the other end of the link.
  • Any data buffered in the link is sent when WSClose() is called.
  • Programs should close all links they have opened before terminating.
  • WSClose() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

int main(int argc, char **argv)
{
    MLENV ep;
    MLINK lp;
    int error;

    ep = WSInitialize((WSParametersPointer)0);
    if(ep == (MLENV)0)
        { /* environment initialization failed */ }

    lp = WSOpenArgv(ep, argv, argv + argc, &error);
    if(lp == (MLINK)0 || error != MLEOK)
        { /* link creation failed */ }

    ...

    WSClose(lp);
    WSDeinitialize(ep);

    return 0;
}