INHUVUT3 ; KAC ; 06 Aug 1999 14:41; Generic TCP/IP socket utilities (continued)
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
Q
;
;
NEXT(INDEST,INPRI,INHOR,INPEND) ;Return next transaction in the destination que.
; Used for single and multiple transceiver execution off of a single
; destination que.
;
; Called by: INHVTAPT,INHVTMT,INHVMTR
;
;Input:
; INDEST - (req) INTERFACE DESTINATION IEN
; INPRI - (pbr) Priority (0-10 to single decimal place e.g. 1.5)
; INHOR - (pbr) Time to process ($H format)
; INPEND - (opt) # of msgs in "pending response" que. Req'd for
; multi-threaded transceivers (INMLTHRD=1))
; INMLTHRD - (opt) flag - 1 = multi-threaded transceiver (INHVTMT)
; 0 = (default) single-threaded transceiver
; INBPN - (req) BACKGROUND PROCESS CONTROL IEN
;
;Output:
; UIF IEN or null if no entry on destination queue
;
N INUIF,INOK,INDT,INTM,INMSG
S (INPRI,INHOR,INUIF)="",INOK=0,INDT=$H,INTM=$P(INDT,",",2),INDT=$P(INDT,",")
F S INPRI=$O(^INLHDEST(INDEST,INPRI)) Q:(+INPRI'=INPRI) D Q:INOK
. S INHOR=""
. F S INHOR=$O(^INLHDEST(INDEST,INPRI,INHOR)) Q:(INHOR="") D Q:INOK
.. I (INHOR<INDT)!((+INHOR=INDT)&($P(INHOR,",",2)'>INTM)) D
... S INUIF=""
... F S INUIF=$O(^INLHDEST(INDEST,INPRI,INHOR,INUIF)) Q:'INUIF D Q:INOK
.... L +^INLHDEST(INDEST,INPRI,INHOR,INUIF):0 I D
..... I '$D(^INTHU(INUIF)) D Q
......; If entry no longer exists in INTHU, log error & get next UIF
...... S INMSG="Missing entry "_INUIF_" in INTHU"
...... K ^INLHDEST(INDEST,INPRI,INHOR,INUIF)
...... D ENT^INHE(INUIF,INDEST,INMSG,INBPN)
...... D:$G(INDEBUG) LOG^INHVCRA1(INMSG,4)
...... L -^INLHDEST(INDEST,INPRI,INHOR,INUIF)
..... I '$G(INMLTHRD) S INOK=1 Q ; NOT multi-threaded xceivers
..... S:$$PUTPEND^INHVTMT4(INDEST,INUIF,.INSEQNUM,.INPEND) INOK=1
..... L -^INLHDEST(INDEST,INPRI,INHOR,INUIF)
;
Q:(INPRI="")!(INHOR="")!(INUIF="")!('INOK) ""
Q INUIF
;
;
INHUVUT3 ; KAC ; 06 Aug 1999 14:41; Generic TCP/IP socket utilities (continued)
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
+3 QUIT
+4 ;
+5 ;
NEXT(INDEST,INPRI,INHOR,INPEND) ;Return next transaction in the destination que.
+1 ; Used for single and multiple transceiver execution off of a single
+2 ; destination que.
+3 ;
+4 ; Called by: INHVTAPT,INHVTMT,INHVMTR
+5 ;
+6 ;Input:
+7 ; INDEST - (req) INTERFACE DESTINATION IEN
+8 ; INPRI - (pbr) Priority (0-10 to single decimal place e.g. 1.5)
+9 ; INHOR - (pbr) Time to process ($H format)
+10 ; INPEND - (opt) # of msgs in "pending response" que. Req'd for
+11 ; multi-threaded transceivers (INMLTHRD=1))
+12 ; INMLTHRD - (opt) flag - 1 = multi-threaded transceiver (INHVTMT)
+13 ; 0 = (default) single-threaded transceiver
+14 ; INBPN - (req) BACKGROUND PROCESS CONTROL IEN
+15 ;
+16 ;Output:
+17 ; UIF IEN or null if no entry on destination queue
+18 ;
+19 NEW INUIF,INOK,INDT,INTM,INMSG
+20 SET (INPRI,INHOR,INUIF)=""
SET INOK=0
SET INDT=$HOROLOG
SET INTM=$PIECE(INDT,",",2)
SET INDT=$PIECE(INDT,",")
+21 FOR
SET INPRI=$ORDER(^INLHDEST(INDEST,INPRI))
IF (+INPRI'=INPRI)
QUIT
Begin DoDot:1
+22 SET INHOR=""
+23 FOR
SET INHOR=$ORDER(^INLHDEST(INDEST,INPRI,INHOR))
IF (INHOR="")
QUIT
Begin DoDot:2
+24 IF (INHOR<INDT)!((+INHOR=INDT)&($PIECE(INHOR,",",2)'>INTM))
Begin DoDot:3
+25 SET INUIF=""
+26 FOR
SET INUIF=$ORDER(^INLHDEST(INDEST,INPRI,INHOR,INUIF))
IF 'INUIF
QUIT
Begin DoDot:4
+27 LOCK +^INLHDEST(INDEST,INPRI,INHOR,INUIF):0
IF $TEST
Begin DoDot:5
+28 IF '$DATA(^INTHU(INUIF))
Begin DoDot:6
+29 ; If entry no longer exists in INTHU, log error & get next UIF
+30 SET INMSG="Missing entry "_INUIF_" in INTHU"
+31 KILL ^INLHDEST(INDEST,INPRI,INHOR,INUIF)
+32 DO ENT^INHE(INUIF,INDEST,INMSG,INBPN)
+33 IF $GET(INDEBUG)
DO LOG^INHVCRA1(INMSG,4)
+34 LOCK -^INLHDEST(INDEST,INPRI,INHOR,INUIF)
End DoDot:6
QUIT
+35 ; NOT multi-threaded xceivers
IF '$GET(INMLTHRD)
SET INOK=1
QUIT
+36 IF $$PUTPEND^INHVTMT4(INDEST,INUIF,.INSEQNUM,.INPEND)
SET INOK=1
+37 LOCK -^INLHDEST(INDEST,INPRI,INHOR,INUIF)
End DoDot:5
End DoDot:4
IF INOK
QUIT
End DoDot:3
End DoDot:2
IF INOK
QUIT
End DoDot:1
IF INOK
QUIT
+38 ;
+39 IF (INPRI="")!(INHOR="")!(INUIF="")!('INOK)
QUIT ""
+40 QUIT INUIF
+41 ;
+42 ;