connect
| connect | 
  Purpose
 
  Synopsis
 
function connect(mi:Mosel, host:string):integer
 
  Arguments
 
| 
     mi 
     | 
     The instance to connect
     | 
| 
     host 
     | 
     A host specification
     | 
  Return value
 
 0 if successful, a positive value otherwise
  Example
 
 Start instance
 inst1 on a separate process:
 
r:=connect(ins1,"")
 With default settings, the 2 following statements are equivalent:
 
r:=connect(ins2,"ariane") r:=connect(ins3,"xsrv:ariane")
  Further information
 
 1. Any Mosel instance has to be connected before it can be used for executing commands.
 
 2. If the
 host provided is an empty string (
 ""), it is replaced by
 "rcmd:" (instance started on the same machine in a separate process). Otherwise, the string
 host is searched in the list of defined aliases (see
 sethostalias) and, if found, it is replaced by the associated text. If the resulting specification does not contain any IO driver reference, a valid specification is generated using the current connection template (see
 conntmpl): each occurrence of the
 %h marker in the template is replaced by the value of
 host.
 
 3. The
 host argument (or the string resulting from the transformations described above) is expected to be an extended file name using an IO driver the task of which is to start a process running the
 mosel program in remote mode and create/manage the communication streams between the processes. The
 mmjobs module provides three drivers supporting this service (see Section
 I/O drivers):
 "rcmd:" to start a Mosel instance on a separate process on the same machine,
 "xsrv:" to start a Mosel instance on a host running the Mosel Remote Launcher (see Section
 The Mosel Remote Launcher xprmsrv) and
 "xssh:" to use a secure connection with an xprmsrv server.
 
  Related topics
 
  Module
 
 
