LinkActivate[lnk]
activates a WSTP connection, waiting for the program at the other end to respond.
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.
- 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
open all close allBasic Examples (2)
Start a subsidiary Wolfram Language kernel process and set it to listen on TCPIP port 8000:
StartProcess[{First[$CommandLine], "-wstp", "-linkprotocol", "TCPIP", "-linkcreate", "-linkname", "8000"}]Connect to the waiting kernel:
link = LinkConnect["8000", LinkProtocol -> "TCPIP"]LinkActivate[link]LinkClose[link]Create a connecting link that has nothing to connect to:
lnk = LinkConnect["bogus"]Activating the link fails and closes the failed LinkObject:
LinkActivate[lnk]Properties & Relations (1)
Unactivated links are listed in Links:
lnk = LinkConnect["bogus"];Cases[Links[], LinkObject["bogus", ___]]This link cannot connect and fails as expected:
LinkActivate[lnk]When LinkActivate fails, it closes the link and removes it from the Links list:
Cases[Links[], LinkObject["bogus", ___]]Related Guides
-
▪
- WSTP API
History
Introduced in 1996 (3.0)
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_2026_linkactivate, author="Wolfram Research", title="{LinkActivate}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/LinkActivate.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_linkactivate, organization={Wolfram Research}, title={LinkActivate}, year={1996}, url={https://reference.wolfram.com/language/ref/LinkActivate.html}, note=[Accessed: 12-June-2026]}