source: Scheduling/trunk/m/BSDX23.m@ 905

Last change on this file since 905 was 888, checked in by Sam Habiel, 14 years ago

Updated version numbers

File size: 2.8 KB
Line 
1BSDX23 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ;
2 ;;1.3T1;BSDX;;Jul 18, 2010
3 ;
4 ;
5EVENT(BSDXEVENT,BSDXPARAM,BSDXSIP,BSDXSPT) ;EP
6 ;Raise event to interested clients
7 ;Clients are listed in ^BSDXTMP("EVENT",EVENT_NAME,IP,PORT)
8 ;BSDXSIP and BSDXSPT represent the sender's IP and PORT.
9 ;The event will not be raised back to the sender if these are non-null
10 ;
11 Q:'$D(^BSDXTMP("EVENT",BSDXEVENT))
12 S BSDXIP=0 F S BSDXIP=$O(^BSDXTMP("EVENT",BSDXEVENT,BSDXIP)) Q:BSDXIP="" D
13 . S BSDXPORT=0 F S BSDXPORT=$O(^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT)) Q:'+BSDXPORT D
14 . . I BSDXIP=BSDXSIP Q ;,BSDXPORT=BSDXSPT Q
15 . . D CALL^%ZISTCP(BSDXIP,BSDXPORT,5)
16 . . I POP K ^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT) Q
17 . . ;U IO R X#3:5
18 . . I X'="ACK" K ^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT) Q
19 . . S BSDXPARAM=$S(BSDXPARAM="":"",1:U_BSDXPARAM)
20 . . U IO W BSDXEVENT,BSDXPARAM,!
21 . . D ^%ZISC
22 . . Q
23 . Q
24 Q
25 ;
26EVERR(BSDXEVENT,BSDXIP,BSDXPORT) ;
27 ;
28 Q:$G(BSDXEVENT)=""
29 Q:$G(BSDXIP)=""
30 Q:$G(BSDXIP)=""
31 K ^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT)
32 Q
33 ;
34REGET ;EP
35 ;Error trap from REGEVNT
36 ;
37 I '$D(BSDXI) N BSDXI S BSDXI=999
38 S BSDXI=BSDXI+1
39 D REGERR(BSDXI,99)
40 Q
41 ;
42REGERR(BSDXI,BSDXERID) ;Error processing
43 S BSDXI=BSDXI+1
44 S ^BSDXTMP($J,BSDXI)=BSDXERID_$C(30)
45 S BSDXI=BSDXI+1
46 S ^BSDXTMP($J,BSDXI)=$C(31)
47 Q
48 ;
49 ;
50REGEVNT(BSDXY,BSDXEVENT,BSDXIP,BSDXPORT) ;EP
51 ;RPC Called by client to inform RPMS server of client's interest in BSDXEVENT
52 ;Returns RECORDSET with field ERRORID.
53 ;If everything ok then ERRORID = 0;
54 ;
55 N BSDXI
56 S BSDXI=0
57 S X="REGET^BSDX23",@^%ZOSF("TRAP")
58 S BSDXY="^BSDXTMP("_$J_")"
59 S ^BSDXTMP($J,0)="I00020ERRORID"_$C(30)
60 I '+BSDXPORT D REGERR(BSDXI,1) Q
61 I BSDXIP="" D REGERR(BSDXI,2) Q
62 S ^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT)=""
63 ;
64 S BSDXI=BSDXI+1
65 S ^BSDXTMP($J,BSDXI)="0"_$C(30)_$C(31)
66 Q
67 ;
68UNREG(BSDXY,BSDXEVENT,BSDXIP,BSDXPORT) ;EP
69 ;RPC Called by client to Unregister client's interest in BSDXEVENT
70 ;Returns RECORDSET with field ERRORID.
71 ;If everything ok then ERRORID = 0;
72 ;
73 N BSDXI
74 S BSDXI=0
75 S X="REGET^BSDX23",@^%ZOSF("TRAP")
76 S BSDXY="^BSDXTMP("_$J_")"
77 S ^BSDXTMP($J,0)="I00020ERRORID"_$C(30)
78 I '+BSDXPORT D REGERR(BSDXI,1) Q
79 I BSDXIP="" D REGERR(BSDXI,2) Q
80 K ^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT)
81 ;
82 S BSDXI=BSDXI+1
83 S ^BSDXTMP($J,BSDXI)="0"_$C(30)_$C(31)
84 Q
85 ;
86RAISEVNT(BSDXY,BSDXEVENT,BSDXPARAM,BSDXSIP,BSDXSPT) ;EP
87 ;RPC Called to raise event BSDXEVENT with parameter BSDXPARAM
88 ;BSDXSIP and BSDXSPT represent the sender's IP and PORT.
89 ;If not null, these will prevent the event from being raised back
90 ;to the sender.
91 ;Returns a RECORDSET wit the field ERRORID.
92 ;If everything ok then ERRORID = 0;
93 ;
94 N BSDXI
95 S BSDXI=0
96 S BSDXY="^BSDXTMP("_$J_")"
97 S ^BSDXTMP($J,0)="I00020ERRORID"_$C(30)
98 S X="REGET^BSDX23",@^%ZOSF("TRAP")
99 ;
100 D EVENT(BSDXEVENT,BSDXPARAM,BSDXSIP,BSDXSPT)
101 ;
102 S BSDXI=BSDXI+1
103 S ^BSDXTMP($J,BSDXI)="0"_$C(30)_$C(31)
104 Q
Note: See TracBrowser for help on using the repository browser.