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

XWBTCPMT.m

Go to the documentation of this file.
XWBTCPMT ;ISF/RWF - Routine to test a connection ;12/02/14  08:48
 ;;1.1;RPC BROKER;**43,49,53,64**;Mar 28, 1997;Build 12
 ;Per VA Directive 6402, this routine should not be modified.
 ;
CALL ;Interactive
 N IP,PORT,STAT
 D HOME^%ZIS
 S U="^",DTIME=$$DTIME^XUP
 W !,"Interactive Broker Test"
 R !,"IP ADDRESS: ",IP:DTIME
 I IP["^" Q
 R !,"PORT: ",PORT:DTIME
 I PORT["^" Q
 S STAT=$$TEST(IP,PORT,1)
 U $P
 W !,$S(STAT>0:"Success, response: "_$P(STAT,U,2),1:"Failed: "_$P(STAT,U,2,9)),!
 Q
 ;
TEST(IP,PORT,TALK) ;
 N T1,T2,T3,T4,OS,RES,RES2,RES3
 S OS=^%ZOSF("OS")
 I '$$VALIDATE^XLFIPV(IP) S IP=$$ADDRESS^XLFNSLK(IP) ;p64
 I '$$VALIDATE^XLFIPV(IP) Q "-1^BAD IP" ;p64
 I OS["OpenM" X "S T1=$ZH"
 D CALL^%ZISTCP(IP,PORT)
 I OS["OpenM" X "S T2=$ZH"
 I POP Q "-1^Failed to Connect"
 U IO
 N $ET S $ET="G ERR^XWBTCPMT"
 ;TCPConnect
 W "[XWB]10304"_$C(10)_"TCPConnect50010127.0.0.1f00010f0024ISF-FORTW.vha.domain.extf"_$C(4),@IOF
 R RES:10 I '$T S RES="-1^TIMEOUT" G EXIT
 I OS["OpenM" X "S T3=$ZH"
 W "[XWB]11302"_$C(1)_"0"_$C(16)_"XUS SIGNON SETUP54f"_$C(4),@IOF
 R RES2:10
 I OS["OpenM" X "S T4=$ZH"
 W "[XWB]10304"_$C(5)_"#BYE#"_$C(4),@IOF
 R RES3:3 I '$T S RES="-1^TIMEOUT after accept" G EXIT
 S RES="1^"_RES_U_($G(T2)-$G(T1))_U_($G(T3)-$G(T2))_U_($G(T4)-$G(T3))
EXIT ;Close and Exit
 D CLOSE^%ZISTCP
 Q RES
 ;
ERR ;
 D CLOSE^%ZISTCP
 U $P
 Q "-1^"_$$EC^%ZOSV
 ;
CHECK ;Check server setup
 N XPARSYS,XWBDEBUG,XWBOS,XWBT,XWNRBUF,XWBTIME,NEWJOB,XWBVER
 W !,"This will check for some of the errors that can"
 W !,"prevent the Broker from getting started.",!
 D HOME^%ZIS
 S XWBVER=1.108
 D INIT^XWBTCPM
 W !,"Debugging is set to ",$S(XWBDEBUG=1:"On",XWBDEBUG=2:"Verbose",XWBDEBUG=3:"Very Verbose",1:"Off")
 D SETTIME^XWBTCPM(0)
 W !,"Broker activity timeout is set to ",XWBTIME
 S %ZIS="M",IOP="NULL" D ^%ZIS
 I POP W !,"The NULL device is not setup correctly."
 I 'POP D
 . W !,"Checking can Write to null device"
 . U IO W !,"TEST",!
 . D ^%ZISC U IO W !,"The NULL device is OK."
 I $T(SHARELIC^%ZOSV)="" W !,"The routine %ZOSV is missing the entry point 'SHARELIC'."
 I $T(GETPEER^%ZOSV)="" W !,"The routine %ZOSV is missing the entry point 'GETPEER'."
 I $G(XWBT("PCNT")),$T(COUNT^XUSCNT)="" W !,"The routine XUSCNT is missing on a GT.M system."
 W !,"Checking if new JOB's can start."
 S ^TMP("XWB",$J)=1 X "J HOLD^XWBTCPMT($J) H 1"
 I $G(^TMP("XWB",$J))=1 W !,"Doesn't look like a new JOB could start!",!
 S NEWJOB=$$NEWJOB^XWBTCPM()
 W !,"New jobs are "_$S('NEWJOB:"not ",1:"")_"allowed."
 W !,"Done with the checks.",!
 K ^TMP("XWB",$J)
 Q
 ;
HOLD(MJ) ;Show that a new job is allowed.
 S ^TMP("XWB",MJ)=5
 HANG 5
 Q