WSWaitForNewLinkFromLinkServer (C Function)

WSLINK WSWaitForNewLinkFromLinkServer(WSLinkServer s, int *err)

waits till link server s has a new connection.

Details

  • WSWaitForNewLinkFromLinkServer() waits synchronously for a client to connect to the link server object.
  • WSWaitForNewLinkFromLinkServer() returns a WSLINK object representing the connection to the new link object.
  • The program must call WSActivate() on the WSLINK object before any other link operations.
  • If WSWaitForNewLinkFromLinkServer() encounters an error it will return the error value in err and return (WSLINK)0. The WSWaitForNewLInkFromLinkServer() succeeds, err will contain zero.
  • The nonzero values that indicate an error condition correspond to the WSE error codes in wstp.h and as returned by WSError().

Examples

Basic Examples  (1)

#include "wstp.h"

void operateLinkServerOnPort(WSENV env, unsigned short port)
{
    int error;
    WSLinkServer linkServer;
    WSLINK theLink;


    linkServer = WSNewLinkServerWithPort(env, port,
        NULL /* No context object for this example */, &error);
    if(error != WSEOK)
    { /* Handle error */ }

    theLink = WSWaitForNewLinkFromLinkserver(linkServer, &error);
    if(theLink == (WSLINK)0 || error != WSEOK)
    { /* Handle error */ }

    ...

    WSCLose(theLink);

    WSShutdownLinkServer(linkServer);
}