LinkActivate

LinkActivate[lnk]

activates a WSTP connection, waiting for the program at the other end to respond.

Details

  • LinkActivate takes a LinkObject, which is typically produced by LinkConnect or LinkCreate.
  • If the other side of the link has not yet been created, then the behavior depends upon whether the link was created by LinkCreate or LinkConnect. If the link was created, then LinkActivate will wait for the link to be both connected and activated. If the link is a connecting link, then LinkActivate will immediately return $Failed and close the link.
  • LinkReadyQ can be used on a listening link to determine whether the other side of the link has been created and, therefore, whether LinkActivate is likely to succeed quickly or to wait.
  • LinkActivate has no effect on a link that has already been activated.
  • LinkRead, LinkWrite, and related calls implicitly activate the links on which they send or receive data.
  • The basic form of LinkActivate corresponds to the WSTP library function WSActivate().
  • Attempts to read from or write to a link automatically activate the link as if LinkActivate had been called.

Examples

Basic Examples  (2)

Start a subsidiary Wolfram Language kernel process and set it to listen on TCPIP port 8000:

Connect to kernel:

Activate the link:

Create a connecting link that has nothing to connect to:

Activating the link fails and closes the failed LinkObject:

Wolfram Research (1996), LinkActivate, Wolfram Language function, https://reference.wolfram.com/language/ref/LinkActivate.html.

Text

Wolfram Research (1996), LinkActivate, Wolfram Language function, https://reference.wolfram.com/language/ref/LinkActivate.html.

CMS

Wolfram Language. 1996. "LinkActivate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LinkActivate.html.

APA

Wolfram Language. (1996). LinkActivate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LinkActivate.html

BibTeX

@misc{reference.wolfram_2024_linkactivate, author="Wolfram Research", title="{LinkActivate}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/LinkActivate.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_linkactivate, organization={Wolfram Research}, title={LinkActivate}, year={1996}, url={https://reference.wolfram.com/language/ref/LinkActivate.html}, note=[Accessed: 21-November-2024 ]}