## CONNECT

PURPOSE:
The CONNECT statement provides a connection between SM32 running on a PC(windows version) and another remote version of SM32(linux server) for the purpose of sharing the local PC's "WINDOW" with the remote version. The connection also allows the local PC to act as a Remote Procedure Call Server (RCALL). The connection can also be used to transfer user defined data between the 2 copies of SM32.

    STATEMENT SYNTAX:
    {stno} CONNECT cnum,ctype,cdata{,err=stno}
    where: cnum - is a connection # (0->9)
           ctype - connection type (currently only type 2)
    	   cdata - connection data - depends on type
           ldata - login data - depends on type

    EXAMPLE:

    0100 CONNECT 0,2,C$,L$

## Connection Type 2

Connection type 2 creates a connection between SM32.EXE(on windows) and sm32server (on linux).sm32server is just a version of linux sm32 that forks a copy of itself for each connections it receives. All data passed over the connection is encrypted. The connection data has the following format:
"IP:PORT" The login data is a ';' delimitted string with the following format:
"USERNAME;PASSWORD;START DIRECTORY;UP FILENAME;DSZ"
EXAMPLE:
100 CONNECT 0,2,"192.168.1.3:5001","ken;kenpw;/u/sm32;sm32pc2;2500000"
In the above example SM32.EXE connects to port 5001 on 192.168.1.3. It then sends the ldata string to sm32server. sm32server verifies the username and password. sm32server then forks and becomes the specified user, changes directory to the one specified and uses the up file name and dsz as its parameters. The up file must specify PC2-REMOTE as its terminal type.

NOTES:
Once a connection is made the remote copy precedes normally until it attempts screen I/O when it will pend as it does not yet have control of the PC2-LOCAL driver on the PC. See the 'CON' mnemonic.