Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: INTSLO

INTSLO.m

Go to the documentation of this file.
  1. INTSLO ;KAC,DP,FRW ; 7 Apr 96 12:26; Access Logon Server
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. Q
  1. ;
  1. EN ;Mian entry point
  1. ; Input:
  1. ; INBPN - Background process (ien)
  1. ; Output:
  1. ; INUIF - Acknowledge message returned from LoS (ien)
  1. ;
  1. N INCHNL,INDEST,INDSTR,INERRTST,INMSGTST,INIP,INRUNTST,INUSEQ,X,Y,Z
  1. S X="ERR^INTSLO",@^%ZOSF("TRAP")
  1. ;
  1. ;Get Test Transmitter parameters from BACKGROUND PROCESS CONTROL file
  1. D INIT^INHUVUT(INBPN,.INIP)
  1. ;
  1. ; Set array of valid inbound INTERFACE DESTINATION names
  1. F X=1:1 S Y=$T(DEST+X) Q:Y'[";;" S Z=$TR($P(Y,";;")," ",""),INDEST(Z)=$P(Y,";;",2)
  1. ;
  1. S INUSEQ=0 ;No sequence number protocol
  1. ;
  1. N INACKUIF,INERR,INMEM,INMSGTST K INDATA
  1. S INMSGTST="INDATA" ; reset local array in which to receive data
  1. ;
  1. ; Select port of the Logon Server from INBPNSR
  1. S X=$O(^INTHPC(INBPNSR,5,0)),INPORTSR=$G(^INTHPC(INBPNSR,5,+X,0))
  1. I 'INPORTSR S MS="No Server port designated for Logon Server" D DEBUG^INTST Q
  1. ;
  1. ;Open a TCP/IP Client connection to the Logon Server
  1. S INERRTST=0,LOOPCNT=0 F LOOPCNT=1:1:10 D Q:INCHNL H 5
  1. . D OPEN^%INET(.INCHNL,.INMEM,INIPADDR,INPORTSR,1)
  1. ;
  1. I 'INCHNL D Q
  1. . S MS="Unable to connect to Logon Server at "_INIPADDR_" / "_INPORTSR
  1. . D DEBUG^INTST
  1. ;
  1. ;Logon message
  1. S INUIF=INLOGZ01 Q:'INUIF
  1. ;
  1. ;Send logon message to LoS
  1. S INERRTST=$$SEND^INHUVUT(INLOGZ01,INCHNL,.INIP)
  1. I 'INERRTST S MS="Unable to send logon message" D DEBUG^INTST Q
  1. ;
  1. RECIV ;receive ackknowledgement back
  1. K INMSGTST
  1. S INERRTST=$$RECEIVE^INHUVUT(.INMSGTST,INCHNL,.INIP,.INERR,.INMEM)
  1. I INERRTST D Q
  1. . S MS="Acknowledgement not received from Logon server" D DEBUG^INTST
  1. ;
  1. ACKIN ;Store ack in INTHU
  1. S INERRTST=$$IN^INHUSEN(INMSGTST,.INDEST,INDSTR,INUSEQ,.INACKUIF,.INERR,"",.INUIF,1)
  1. I INERRTST D Q
  1. . S MS="Error storing acknowledgement message from Logon Server"
  1. . D DEBUG^INTST
  1. ;
  1. D CLOSE
  1. ;
  1. Q
  1. ;
  1. CLOSE ;Close socket
  1. D:$G(INCHNL) CLOSE^%INET(INCHNL)
  1. Q
  1. ;
  1. ERR ; Error handler
  1. W !,$$ERRMSG^INHU1
  1. D CLOSE
  1. ;
  1. ;
  1. DEST ; The following tags identify valid message destinations.
  1. ACKACK ;;TEST INTERACTIVE
  1. ;