LinkConnect

LinkConnect["name"]
connects to a WSTP link created by another program.

Details and OptionsDetails 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 and can typically create WSTP links whenever they are given commandline arguments.
  • LinkConnect internally calls a function analogous to the 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.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

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

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input

Connect to :

In[4]:=
Click for copyable input
Out[4]=

Read the first packets:

In[5]:=
Click for copyable input
Out[5]=
In[6]:=
Click for copyable input
Out[6]=

Get the $ProcessID of :

In[7]:=
Click for copyable input
In[8]:=
Click for copyable input
Out[8]=

$ProcessID of the current Wolfram System session:

In[9]:=
Click for copyable input
Out[9]=

Close and the link:

In[10]:=
Click for copyable input
Introduced in 1996
(3.0)