LinkConnect

LinkConnect["name"]

connects to a WSTP link created by another program.

Details and Options

  • LinkConnect by default uses shared memory links.
  • The option LinkProtocol allows other data transport protocols to be specified.
  • LinkConnect can connect to a port on a remote computer system with the option setting LinkProtocol->"TCPIP".
  • LinkConnect returns a LinkObject.
  • You can use LinkConnect with LinkCreate to set up peertopeer communication between two Wolfram System processes.
  • LinkConnect can be used to connect to a link created by calling LinkCreate in another Wolfram System process.
  • LinkConnect can be used to connect to an external program that has created a WSTP link by calling the appropriate WSTP library functions.
  • External programs built from WSTP templates using mcc and mprep can typically create WSTP links whenever they are given -linkcreate commandline arguments.
  • LinkConnect internally calls a function analogous to the WSOpenArgv() function in the WSTP library.
  • Even though no program may yet be connected to the other end of the WSTP link, the function LinkConnect will return immediately and will not block.

Examples

Basic Examples  (1)

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

Connect to kernel:

Read the first packets:

Get the $ProcessID of kernel:

$ProcessID of the current Wolfram System session:

Close kernel and the link:

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

Text

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

CMS

Wolfram Language. 1996. "LinkConnect." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/LinkConnect.html.

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_linkconnect, organization={Wolfram Research}, title={LinkConnect}, year={2007}, url={https://reference.wolfram.com/language/ref/LinkConnect.html}, note=[Accessed: 22-November-2024 ]}