BPX1CON (connect) example

The following code connects to a socket. SOCKDESC was returned by a previous call to BPX1SOC, and SOCKADDR contains the name of the peer, possibly obtained by a call to BPX1GNM. For the callable service, see connect (BPX1CON, BPX4CON) — Establish a connection between two sockets. For the data structure, see BPXYSOCK — Map SOCKADDR structure and constants. AMODE 64 callers use BPX4CON (connect) example.
                                              
         SPACE ,                                                        
         MVI   SOCK_LEN,12           Store the length of the address    
         MVI   SOCK_FAMILY,AF_UNIX   Set the domain to AF_UNIX          
         MVC   SOCK_SUN_NAME(12),=CL12'/tmp/socket1'  Set the name      
         CALL  BPX1CON,              Connect to a socket               +
               (SOCKDESC,            Input: Socket Descriptor          +
               SOCK#LEN+SOCK_SUN#LEN, Input: Length - Sockaddr         +
               SOCKADDR,             Input: Sockaddr structure         +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               VL,MF=(E,PLIST)       ----------------------------------