INTSLO ;KAC,DP,FRW ; 7 Apr 96 12:26; Access Logon Server
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
;
Q
;
EN ;Mian entry point
; Input:
; INBPN - Background process (ien)
; Output:
; INUIF - Acknowledge message returned from LoS (ien)
;
N INCHNL,INDEST,INDSTR,INERRTST,INMSGTST,INIP,INRUNTST,INUSEQ,X,Y,Z
S X="ERR^INTSLO",@^%ZOSF("TRAP")
;
;Get Test Transmitter parameters from BACKGROUND PROCESS CONTROL file
D INIT^INHUVUT(INBPN,.INIP)
;
; Set array of valid inbound INTERFACE DESTINATION names
F X=1:1 S Y=$T(DEST+X) Q:Y'[";;" S Z=$TR($P(Y,";;")," ",""),INDEST(Z)=$P(Y,";;",2)
;
S INUSEQ=0 ;No sequence number protocol
;
N INACKUIF,INERR,INMEM,INMSGTST K INDATA
S INMSGTST="INDATA" ; reset local array in which to receive data
;
; Select port of the Logon Server from INBPNSR
S X=$O(^INTHPC(INBPNSR,5,0)),INPORTSR=$G(^INTHPC(INBPNSR,5,+X,0))
I 'INPORTSR S MS="No Server port designated for Logon Server" D DEBUG^INTST Q
;
;Open a TCP/IP Client connection to the Logon Server
S INERRTST=0,LOOPCNT=0 F LOOPCNT=1:1:10 D Q:INCHNL H 5
. D OPEN^%INET(.INCHNL,.INMEM,INIPADDR,INPORTSR,1)
;
I 'INCHNL D Q
. S MS="Unable to connect to Logon Server at "_INIPADDR_" / "_INPORTSR
. D DEBUG^INTST
;
;Logon message
S INUIF=INLOGZ01 Q:'INUIF
;
;Send logon message to LoS
S INERRTST=$$SEND^INHUVUT(INLOGZ01,INCHNL,.INIP)
I 'INERRTST S MS="Unable to send logon message" D DEBUG^INTST Q
;
RECIV ;receive ackknowledgement back
K INMSGTST
S INERRTST=$$RECEIVE^INHUVUT(.INMSGTST,INCHNL,.INIP,.INERR,.INMEM)
I INERRTST D Q
. S MS="Acknowledgement not received from Logon server" D DEBUG^INTST
;
ACKIN ;Store ack in INTHU
S INERRTST=$$IN^INHUSEN(INMSGTST,.INDEST,INDSTR,INUSEQ,.INACKUIF,.INERR,"",.INUIF,1)
I INERRTST D Q
. S MS="Error storing acknowledgement message from Logon Server"
. D DEBUG^INTST
;
D CLOSE
;
Q
;
CLOSE ;Close socket
D:$G(INCHNL) CLOSE^%INET(INCHNL)
Q
;
ERR ; Error handler
W !,$$ERRMSG^INHU1
D CLOSE
;
;
DEST ; The following tags identify valid message destinations.
ACKACK ;;TEST INTERACTIVE
;
INTSLO ;KAC,DP,FRW ; 7 Apr 96 12:26; Access Logon Server
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
+3 ;
+4 QUIT
+5 ;
EN ;Mian entry point
+1 ; Input:
+2 ; INBPN - Background process (ien)
+3 ; Output:
+4 ; INUIF - Acknowledge message returned from LoS (ien)
+5 ;
+6 NEW INCHNL,INDEST,INDSTR,INERRTST,INMSGTST,INIP,INRUNTST,INUSEQ,X,Y,Z
+7 SET X="ERR^INTSLO"
SET @^%ZOSF("TRAP")
+8 ;
+9 ;Get Test Transmitter parameters from BACKGROUND PROCESS CONTROL file
+10 DO INIT^INHUVUT(INBPN,.INIP)
+11 ;
+12 ; Set array of valid inbound INTERFACE DESTINATION names
+13 FOR X=1:1
SET Y=$TEXT(DEST+X)
IF Y'[";;"
QUIT
SET Z=$TRANSLATE($PIECE(Y,";;")," ","")
SET INDEST(Z)=$PIECE(Y,";;",2)
+14 ;
+15 ;No sequence number protocol
SET INUSEQ=0
+16 ;
+17 NEW INACKUIF,INERR,INMEM,INMSGTST
KILL INDATA
+18 ; reset local array in which to receive data
SET INMSGTST="INDATA"
+19 ;
+20 ; Select port of the Logon Server from INBPNSR
+21 SET X=$ORDER(^INTHPC(INBPNSR,5,0))
SET INPORTSR=$GET(^INTHPC(INBPNSR,5,+X,0))
+22 IF 'INPORTSR
SET MS="No Server port designated for Logon Server"
DO DEBUG^INTST
QUIT
+23 ;
+24 ;Open a TCP/IP Client connection to the Logon Server
+25 SET INERRTST=0
SET LOOPCNT=0
FOR LOOPCNT=1:1:10
Begin DoDot:1
+26 DO OPEN^%INET(.INCHNL,.INMEM,INIPADDR,INPORTSR,1)
End DoDot:1
IF INCHNL
QUIT
HANG 5
+27 ;
+28 IF 'INCHNL
Begin DoDot:1
+29 SET MS="Unable to connect to Logon Server at "_INIPADDR_" / "_INPORTSR
+30 DO DEBUG^INTST
End DoDot:1
QUIT
+31 ;
+32 ;Logon message
+33 SET INUIF=INLOGZ01
IF 'INUIF
QUIT
+34 ;
+35 ;Send logon message to LoS
+36 SET INERRTST=$$SEND^INHUVUT(INLOGZ01,INCHNL,.INIP)
+37 IF 'INERRTST
SET MS="Unable to send logon message"
DO DEBUG^INTST
QUIT
+38 ;
RECIV ;receive ackknowledgement back
+1 KILL INMSGTST
+2 SET INERRTST=$$RECEIVE^INHUVUT(.INMSGTST,INCHNL,.INIP,.INERR,.INMEM)
+3 IF INERRTST
Begin DoDot:1
+4 SET MS="Acknowledgement not received from Logon server"
DO DEBUG^INTST
End DoDot:1
QUIT
+5 ;
ACKIN ;Store ack in INTHU
+1 SET INERRTST=$$IN^INHUSEN(INMSGTST,.INDEST,INDSTR,INUSEQ,.INACKUIF,.INERR,"",.INUIF,1)
+2 IF INERRTST
Begin DoDot:1
+3 SET MS="Error storing acknowledgement message from Logon Server"
+4 DO DEBUG^INTST
End DoDot:1
QUIT
+5 ;
+6 DO CLOSE
+7 ;
+8 QUIT
+9 ;
CLOSE ;Close socket
+1 IF $GET(INCHNL)
DO CLOSE^%INET(INCHNL)
+2 QUIT
+3 ;
ERR ; Error handler
+1 WRITE !,$$ERRMSG^INHU1
+2 DO CLOSE
+3 ;
+4 ;
DEST ; The following tags identify valid message destinations.
ACKACK ;;TEST INTERACTIVE
+1 ;