node-opcua-client 2.98.0 → 2.98.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alarms_and_conditions/client_alarm.d.ts +49 -0
- package/dist/alarms_and_conditions/client_alarm.js +110 -0
- package/dist/alarms_and_conditions/client_alarm.js.map +1 -0
- package/dist/alarms_and_conditions/client_alarm_list.d.ts +25 -0
- package/dist/alarms_and_conditions/client_alarm_list.js +98 -0
- package/dist/alarms_and_conditions/client_alarm_list.js.map +1 -0
- package/dist/alarms_and_conditions/client_alarm_tools.d.ts +4 -0
- package/dist/alarms_and_conditions/client_alarm_tools.js +157 -0
- package/dist/alarms_and_conditions/client_alarm_tools.js.map +1 -0
- package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.d.ts +18 -0
- package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js +193 -0
- package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js.map +1 -0
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.d.ts +9 -0
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js +73 -0
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js.map +1 -0
- package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.d.ts +3 -0
- package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js +119 -0
- package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js.map +1 -0
- package/dist/alarms_and_conditions/client_tools.d.ts +7 -0
- package/dist/alarms_and_conditions/client_tools.js +180 -0
- package/dist/alarms_and_conditions/client_tools.js.map +1 -0
- package/dist/client_base.d.ts +277 -0
- package/dist/client_base.js +15 -0
- package/dist/client_base.js.map +1 -0
- package/dist/client_monitored_item.d.ts +21 -0
- package/dist/client_monitored_item.js +12 -0
- package/dist/client_monitored_item.js.map +1 -0
- package/dist/client_monitored_item_base.d.ts +39 -0
- package/dist/client_monitored_item_base.js +3 -0
- package/dist/client_monitored_item_base.js.map +1 -0
- package/dist/client_monitored_item_group.d.ts +21 -0
- package/dist/client_monitored_item_group.js +14 -0
- package/dist/client_monitored_item_group.js.map +1 -0
- package/dist/client_monitored_item_toolbox.d.ts +15 -0
- package/dist/client_monitored_item_toolbox.js +117 -0
- package/dist/client_monitored_item_toolbox.js.map +1 -0
- package/dist/client_session.d.ts +529 -0
- package/dist/client_session.js +11 -0
- package/dist/client_session.js.map +1 -0
- package/dist/client_session_keepalive_manager.d.ts +34 -0
- package/dist/client_session_keepalive_manager.js +150 -0
- package/dist/client_session_keepalive_manager.js.map +1 -0
- package/dist/client_subscription.d.ts +241 -0
- package/dist/client_subscription.js +15 -0
- package/dist/client_subscription.js.map +1 -0
- package/dist/client_utils.d.ts +22 -0
- package/dist/client_utils.js +88 -0
- package/dist/client_utils.js.map +1 -0
- package/dist/common.d.ts +17 -0
- package/dist/common.js +6 -0
- package/dist/common.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/opcua_client.d.ts +118 -0
- package/dist/opcua_client.js +34 -0
- package/dist/opcua_client.js.map +1 -0
- package/dist/private/client_base_impl.d.ts +160 -0
- package/dist/private/client_base_impl.js +1349 -0
- package/dist/private/client_base_impl.js.map +1 -0
- package/dist/private/client_monitored_item_base_impl.d.ts +3 -0
- package/dist/private/client_monitored_item_base_impl.js +5 -0
- package/dist/private/client_monitored_item_base_impl.js.map +1 -0
- package/dist/private/client_monitored_item_group_impl.d.ts +53 -0
- package/dist/private/client_monitored_item_group_impl.js +162 -0
- package/dist/private/client_monitored_item_group_impl.js.map +1 -0
- package/dist/private/client_monitored_item_impl.d.ts +93 -0
- package/dist/private/client_monitored_item_impl.js +305 -0
- package/dist/private/client_monitored_item_impl.js.map +1 -0
- package/dist/private/client_publish_engine.d.ts +62 -0
- package/dist/private/client_publish_engine.js +409 -0
- package/dist/private/client_publish_engine.js.map +1 -0
- package/dist/private/client_session_impl.d.ts +631 -0
- package/dist/private/client_session_impl.js +1349 -0
- package/dist/private/client_session_impl.js.map +1 -0
- package/dist/private/client_subscription_impl.d.ts +93 -0
- package/dist/private/client_subscription_impl.js +780 -0
- package/dist/private/client_subscription_impl.js.map +1 -0
- package/dist/private/i_private_client.d.ts +21 -0
- package/dist/private/i_private_client.js +3 -0
- package/dist/private/i_private_client.js.map +1 -0
- package/dist/private/opcua_client_impl.d.ts +166 -0
- package/dist/private/opcua_client_impl.js +1001 -0
- package/dist/private/opcua_client_impl.js.map +1 -0
- package/dist/private/performance.d.ts +1 -0
- package/dist/private/performance.js +19 -0
- package/dist/private/performance.js.map +1 -0
- package/dist/reconnection.d.ts +9 -0
- package/dist/reconnection.js +382 -0
- package/dist/reconnection.js.map +1 -0
- package/dist/tools/findservers.d.ts +20 -0
- package/dist/tools/findservers.js +62 -0
- package/dist/tools/findservers.js.map +1 -0
- package/dist/tools/read_history_server_capabilities.d.ts +6 -0
- package/dist/tools/read_history_server_capabilities.js +99 -0
- package/dist/tools/read_history_server_capabilities.js.map +1 -0
- package/dist/user_identity_info.d.ts +1 -0
- package/dist/user_identity_info.js +3 -0
- package/dist/user_identity_info.js.map +1 -0
- package/dist/verify.d.ts +5 -0
- package/dist/verify.js +135 -0
- package/dist/verify.js.map +1 -0
- package/package.json +48 -44
- package/.nycrc.json +0 -14
- package/test_helpers/create_certificates.js +0 -1
- package/typedoc.js +0 -20
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientSidePublishEngine = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @module node-opcua-client-private
|
|
6
|
+
*/
|
|
7
|
+
const async = require("async");
|
|
8
|
+
const chalk = require("chalk");
|
|
9
|
+
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
10
|
+
const node_opcua_debug_1 = require("node-opcua-debug");
|
|
11
|
+
const node_opcua_service_subscription_1 = require("node-opcua-service-subscription");
|
|
12
|
+
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
13
|
+
const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
|
|
14
|
+
const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
|
|
15
|
+
const warningLog = (0, node_opcua_debug_1.make_warningLog)(__filename);
|
|
16
|
+
/**
|
|
17
|
+
* A client side implementation to deal with publish service.
|
|
18
|
+
*
|
|
19
|
+
* @class ClientSidePublishEngine
|
|
20
|
+
* The ClientSidePublishEngine encapsulates the mechanism to
|
|
21
|
+
* deal with a OPCUA Server and constantly sending PublishRequest
|
|
22
|
+
* The ClientSidePublishEngine also performs notification acknowledgements.
|
|
23
|
+
* Finally, ClientSidePublishEngine dispatch PublishResponse to the correct
|
|
24
|
+
* Subscription id callback
|
|
25
|
+
*
|
|
26
|
+
* @param session {ClientSession} - the client session
|
|
27
|
+
*
|
|
28
|
+
*
|
|
29
|
+
* @constructor
|
|
30
|
+
*/
|
|
31
|
+
class ClientSidePublishEngine {
|
|
32
|
+
constructor(session) {
|
|
33
|
+
this.session = session;
|
|
34
|
+
this.subscriptionAcknowledgements = [];
|
|
35
|
+
this.subscriptionMap = {};
|
|
36
|
+
this.timeoutHint = 10000; // 10 s by default
|
|
37
|
+
this.activeSubscriptionCount = 0;
|
|
38
|
+
// number of pending Publish request sent to the server and awaited for being processed by the server
|
|
39
|
+
this.nbPendingPublishRequests = 0;
|
|
40
|
+
// the maximum number of publish requests we think that the server can queue.
|
|
41
|
+
// we will adjust this value .
|
|
42
|
+
this.nbMaxPublishRequestsAcceptedByServer = 1000;
|
|
43
|
+
this.isSuspended = false;
|
|
44
|
+
(0, node_opcua_assert_1.assert)(this.session, "Session must exist");
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* the number of active subscriptions managed by this publish engine.
|
|
48
|
+
* @property subscriptionCount
|
|
49
|
+
* @type {Number}
|
|
50
|
+
*/
|
|
51
|
+
get subscriptionCount() {
|
|
52
|
+
return Object.keys(this.subscriptionMap).length;
|
|
53
|
+
}
|
|
54
|
+
suspend(suspendedState) {
|
|
55
|
+
if (this.isSuspended === suspendedState) {
|
|
56
|
+
// nothing to do ...
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.isSuspended = suspendedState;
|
|
60
|
+
if (!this.isSuspended) {
|
|
61
|
+
this.replenish_publish_request_queue();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
acknowledge_notification(subscriptionId, sequenceNumber) {
|
|
65
|
+
this.subscriptionAcknowledgements.push({ subscriptionId, sequenceNumber });
|
|
66
|
+
}
|
|
67
|
+
cleanup_acknowledgment_for_subscription(subscriptionId) {
|
|
68
|
+
this.subscriptionAcknowledgements = this.subscriptionAcknowledgements.filter((a) => a.subscriptionId !== subscriptionId);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* @method send_publish_request
|
|
72
|
+
*/
|
|
73
|
+
send_publish_request() {
|
|
74
|
+
if (this.isSuspended) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (this.nbPendingPublishRequests >= this.nbMaxPublishRequestsAcceptedByServer) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const session = this.session;
|
|
81
|
+
if (session && !session.isChannelValid()) {
|
|
82
|
+
// wait for channel to be valid
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
if (this.subscriptionCount) {
|
|
85
|
+
this.send_publish_request();
|
|
86
|
+
}
|
|
87
|
+
}, 100);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
setImmediate(() => {
|
|
91
|
+
if (!this.session || this.isSuspended) {
|
|
92
|
+
// session has been terminated or suspended
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this.internalSendPublishRequest();
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
terminate() {
|
|
100
|
+
debugLog("Terminated ClientPublishEngine ");
|
|
101
|
+
this.session = null;
|
|
102
|
+
}
|
|
103
|
+
registerSubscription(subscription) {
|
|
104
|
+
debugLog("ClientSidePublishEngine#registerSubscription ", subscription.subscriptionId);
|
|
105
|
+
const _subscription = subscription;
|
|
106
|
+
(0, node_opcua_assert_1.assert)(arguments.length === 1);
|
|
107
|
+
(0, node_opcua_assert_1.assert)(isFinite(subscription.subscriptionId));
|
|
108
|
+
(0, node_opcua_assert_1.assert)(!Object.prototype.hasOwnProperty.call(this.subscriptionMap, subscription.subscriptionId)); // already registered ?
|
|
109
|
+
(0, node_opcua_assert_1.assert)(typeof _subscription.onNotificationMessage === "function");
|
|
110
|
+
(0, node_opcua_assert_1.assert)(isFinite(subscription.timeoutHint));
|
|
111
|
+
this.activeSubscriptionCount += 1;
|
|
112
|
+
this.subscriptionMap[subscription.subscriptionId] = _subscription;
|
|
113
|
+
this.timeoutHint = Math.min(Math.max(this.timeoutHint, subscription.timeoutHint), 0x7ffffff);
|
|
114
|
+
debugLog(" setting timeoutHint = ", this.timeoutHint, subscription.timeoutHint);
|
|
115
|
+
this.replenish_publish_request_queue();
|
|
116
|
+
}
|
|
117
|
+
replenish_publish_request_queue() {
|
|
118
|
+
// Spec 1.03 part 4 5.13.5 Publish
|
|
119
|
+
// [..] in high latency networks, the Client may wish to pipeline Publish requests
|
|
120
|
+
// to ensure cyclic reporting from the Server. Pipe-lining involves sending more than one Publish
|
|
121
|
+
// request for each Subscription before receiving a response. For example, if the network introduces a
|
|
122
|
+
// delay between the Client and the Server of 5 seconds and the publishing interval for a Subscription
|
|
123
|
+
// is one second, then the Client will have to issue Publish requests every second instead of waiting for
|
|
124
|
+
// a response to be received before sending the next request.
|
|
125
|
+
this.send_publish_request();
|
|
126
|
+
// send more than one publish request to server to cope with latency
|
|
127
|
+
for (let i = 0; i < ClientSidePublishEngine.publishRequestCountInPipeline - 1; i++) {
|
|
128
|
+
this.send_publish_request();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* @method unregisterSubscription
|
|
133
|
+
*
|
|
134
|
+
* @param subscriptionId
|
|
135
|
+
*/
|
|
136
|
+
unregisterSubscription(subscriptionId) {
|
|
137
|
+
debugLog("ClientSidePublishEngine#unregisterSubscription ", subscriptionId);
|
|
138
|
+
(0, node_opcua_assert_1.assert)(isFinite(subscriptionId) && subscriptionId > 0);
|
|
139
|
+
this.activeSubscriptionCount -= 1;
|
|
140
|
+
// note : it is possible that we get here while the server has already requested
|
|
141
|
+
// a session shutdown ... in this case it is possible that subscriptionId is already
|
|
142
|
+
// removed
|
|
143
|
+
if (Object.prototype.hasOwnProperty.call(this.subscriptionMap, subscriptionId)) {
|
|
144
|
+
delete this.subscriptionMap[subscriptionId];
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
debugLog("ClientSidePublishEngine#unregisterSubscription cannot find subscription ", subscriptionId);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
getSubscriptionIds() {
|
|
151
|
+
return Object.keys(this.subscriptionMap).map((a) => parseInt(a, 10));
|
|
152
|
+
}
|
|
153
|
+
/***
|
|
154
|
+
* get the client subscription from Id
|
|
155
|
+
*/
|
|
156
|
+
getSubscription(subscriptionId) {
|
|
157
|
+
(0, node_opcua_assert_1.assert)(isFinite(subscriptionId) && subscriptionId > 0);
|
|
158
|
+
(0, node_opcua_assert_1.assert)(Object.prototype.hasOwnProperty.call(this.subscriptionMap, subscriptionId));
|
|
159
|
+
return this.subscriptionMap[subscriptionId];
|
|
160
|
+
}
|
|
161
|
+
hasSubscription(subscriptionId) {
|
|
162
|
+
(0, node_opcua_assert_1.assert)(isFinite(subscriptionId) && subscriptionId > 0);
|
|
163
|
+
return Object.prototype.hasOwnProperty.call(this.subscriptionMap, subscriptionId);
|
|
164
|
+
}
|
|
165
|
+
republish(callback) {
|
|
166
|
+
// After re-establishing the connection the Client shall call Republish in a loop, starting with
|
|
167
|
+
// the next expected sequence number and incrementing the sequence number until the Server returns
|
|
168
|
+
// the status BadMessageNotAvailable.
|
|
169
|
+
// After receiving this status, the Client shall start sending Publish requests with the normal Publish
|
|
170
|
+
// handling.
|
|
171
|
+
// This sequence ensures that the lost NotificationMessages queued in the Server are not overwritten
|
|
172
|
+
// by newPublish responses
|
|
173
|
+
/**
|
|
174
|
+
* call Republish continuously until all Notification messages of
|
|
175
|
+
* un-acknowledged notifications are reprocessed.
|
|
176
|
+
* @private
|
|
177
|
+
*/
|
|
178
|
+
const repairSubscription = (subscription, subscriptionId, innerCallback) => {
|
|
179
|
+
subscriptionId = parseInt(subscriptionId, 10);
|
|
180
|
+
this.__repairSubscription(subscription, subscriptionId, innerCallback);
|
|
181
|
+
};
|
|
182
|
+
async.forEachOf(this.subscriptionMap, repairSubscription, callback);
|
|
183
|
+
}
|
|
184
|
+
internalSendPublishRequest() {
|
|
185
|
+
(0, node_opcua_assert_1.assert)(this.session, "ClientSidePublishEngine terminated ?");
|
|
186
|
+
this.nbPendingPublishRequests += 1;
|
|
187
|
+
debugLog(chalk.yellow("sending publish request "), this.nbPendingPublishRequests);
|
|
188
|
+
const subscriptionAcknowledgements = this.subscriptionAcknowledgements;
|
|
189
|
+
this.subscriptionAcknowledgements = [];
|
|
190
|
+
// as started in the spec (Spec 1.02 part 4 page 81 5.13.2.2 Function DequeuePublishReq())
|
|
191
|
+
// the server will dequeue the PublishRequest in first-in first-out order
|
|
192
|
+
// and will validate if the publish request is still valid by checking the timeoutHint in the RequestHeader.
|
|
193
|
+
// If the request timed out, the server will send a BadTimeout service result for the request and de-queue
|
|
194
|
+
// another publish request.
|
|
195
|
+
//
|
|
196
|
+
// in Part 4. page 144 Request Header the timeoutHint is described this way.
|
|
197
|
+
// timeoutHint UInt32 This timeout in milliseconds is used in the Client side Communication Stack to
|
|
198
|
+
// set the timeout on a per-call base.
|
|
199
|
+
// For a Server this timeout is only a hint and can be used to cancel long running
|
|
200
|
+
// operations to free resources. If the Server detects a timeout, he can cancel the
|
|
201
|
+
// operation by sending the Service result BadTimeout. The Server should wait
|
|
202
|
+
// at minimum the timeout after he received the request before cancelling the operation.
|
|
203
|
+
// The value of 0 indicates no timeout.
|
|
204
|
+
// In issue#40 (MonitoredItem on changed not fired), we have found that some server might wrongly interpret
|
|
205
|
+
// the timeoutHint of the request header ( and will bang a BadTimeout regardless if client send timeoutHint=0)
|
|
206
|
+
// as a work around here , we force the timeoutHint to be set to a suitable value.
|
|
207
|
+
//
|
|
208
|
+
// see https://github.com/node-opcua/node-opcua/issues/141
|
|
209
|
+
// This suitable value shall be at least the time between two keep alive signal that the server will send.
|
|
210
|
+
// (i.e revisedLifetimeCount * revisedPublishingInterval)
|
|
211
|
+
// also ( part 3 - Release 1.03 page 140)
|
|
212
|
+
// The Server shall check the timeoutHint parameter of a PublishRequest before processing a PublishResponse.
|
|
213
|
+
// If the request timed out, a BadTimeout Service result is sent and another PublishRequest is used.
|
|
214
|
+
// The value of 0 indicates no timeout
|
|
215
|
+
// in our case:
|
|
216
|
+
(0, node_opcua_assert_1.assert)(this.nbPendingPublishRequests > 0);
|
|
217
|
+
const calculatedTimeout = Math.min(0x7FFFFFFF, this.nbPendingPublishRequests * this.timeoutHint);
|
|
218
|
+
const publishRequest = new node_opcua_service_subscription_1.PublishRequest({
|
|
219
|
+
requestHeader: { timeoutHint: calculatedTimeout },
|
|
220
|
+
subscriptionAcknowledgements
|
|
221
|
+
});
|
|
222
|
+
let active = true;
|
|
223
|
+
const session = this.session;
|
|
224
|
+
session.publish(publishRequest, (err, response) => {
|
|
225
|
+
this.nbPendingPublishRequests -= 1;
|
|
226
|
+
if (err) {
|
|
227
|
+
debugLog(chalk.cyan("ClientSidePublishEngine.prototype.internalSendPublishRequest callback : "), chalk.yellow(err.message));
|
|
228
|
+
debugLog("'" + err.message + "'");
|
|
229
|
+
if (err.message.match("not connected")) {
|
|
230
|
+
debugLog(chalk.bgWhite.red(" WARNING : CLIENT IS NOT CONNECTED :" + " MAY BE RECONNECTION IS IN PROGRESS"));
|
|
231
|
+
debugLog("this.activeSubscriptionCount =", this.activeSubscriptionCount);
|
|
232
|
+
// the previous publish request has ended up with an error because
|
|
233
|
+
// the connection has failed ...
|
|
234
|
+
// There is no need to send more publish request for the time being until reconnection is completed
|
|
235
|
+
active = false;
|
|
236
|
+
}
|
|
237
|
+
// istanbul ignore next
|
|
238
|
+
if (err.message.match(/BadNoSubscription/) && this.activeSubscriptionCount >= 1) {
|
|
239
|
+
// there is something wrong happening here.
|
|
240
|
+
// the server tells us that there is no subscription for this session
|
|
241
|
+
// but the client have some active subscription left.
|
|
242
|
+
// This could happen if the client has missed or not received the StatusChange Notification
|
|
243
|
+
debugLog(chalk.bgWhite.red(" WARNING : SERVER TELLS THAT IT HAS NO SUBSCRIPTION , " + "BUT CLIENT DISAGREE"));
|
|
244
|
+
debugLog("this.activeSubscriptionCount =", this.activeSubscriptionCount);
|
|
245
|
+
active = false;
|
|
246
|
+
}
|
|
247
|
+
if (err.message.match(/BadSessionClosed|BadSessionIdInvalid/)) {
|
|
248
|
+
//
|
|
249
|
+
// server has closed the session ....
|
|
250
|
+
// may be the session timeout is shorted than the subscription life time
|
|
251
|
+
// and the client does not send intermediate keepAlive request to keep the connection working.
|
|
252
|
+
//
|
|
253
|
+
debugLog(chalk.bgWhite.red(" WARNING : SERVER TELLS THAT THE SESSION HAS CLOSED ..."));
|
|
254
|
+
debugLog(" the ClientSidePublishEngine shall now be disabled," + " as server will reject any further request");
|
|
255
|
+
// close all active subscription....
|
|
256
|
+
active = false;
|
|
257
|
+
}
|
|
258
|
+
if (err.message.match(/BadTooManyPublishRequests/)) {
|
|
259
|
+
// preventing queue overflow
|
|
260
|
+
// -------------------------
|
|
261
|
+
// if the client send too many publish requests that the server can queue, the server returns
|
|
262
|
+
// a Service result of BadTooManyPublishRequests.
|
|
263
|
+
//
|
|
264
|
+
// let adjust the nbMaxPublishRequestsAcceptedByServer value so we never overflow the server
|
|
265
|
+
// with extraneous publish requests in the future.
|
|
266
|
+
//
|
|
267
|
+
this.nbMaxPublishRequestsAcceptedByServer = Math.min(this.nbPendingPublishRequests, this.nbMaxPublishRequestsAcceptedByServer);
|
|
268
|
+
active = false;
|
|
269
|
+
warningLog(chalk.bgWhite.red(" WARNING : SERVER TELLS THAT TOO MANY" + " PUBLISH REQUEST HAS BEEN SEND ..."));
|
|
270
|
+
warningLog(" On our side nbPendingPublishRequests = ", this.nbPendingPublishRequests);
|
|
271
|
+
warningLog(" => nbMaxPublishRequestsAcceptedByServer =", this.nbMaxPublishRequestsAcceptedByServer);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
if (doDebug) {
|
|
276
|
+
debugLog(chalk.cyan("ClientSidePublishEngine.prototype.internalSendPublishRequest callback "));
|
|
277
|
+
}
|
|
278
|
+
this._receive_publish_response(response);
|
|
279
|
+
}
|
|
280
|
+
// feed the server with a new publish Request to the server
|
|
281
|
+
if (!this.isSuspended && active && this.activeSubscriptionCount > 0) {
|
|
282
|
+
if (err && err.message.match(/Connection Break/)) {
|
|
283
|
+
// do not renew when connection is broken
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
this.send_publish_request();
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
_receive_publish_response(response) {
|
|
292
|
+
debugLog(chalk.yellow("receive publish response"));
|
|
293
|
+
// the id of the subscription sending the notification message
|
|
294
|
+
const subscriptionId = response.subscriptionId;
|
|
295
|
+
// the sequence numbers available in this subscription
|
|
296
|
+
// for retransmission and not acknowledged by the client
|
|
297
|
+
// -- var available_seq = response.availableSequenceNumbers;
|
|
298
|
+
// has the server more notification for us ?
|
|
299
|
+
// -- var moreNotifications = response.moreNotifications;
|
|
300
|
+
const notificationMessage = response.notificationMessage;
|
|
301
|
+
// notificationMessage.sequenceNumber
|
|
302
|
+
// notificationMessage.publishTime
|
|
303
|
+
// notificationMessage.notificationData[]
|
|
304
|
+
notificationMessage.notificationData = notificationMessage.notificationData || [];
|
|
305
|
+
if (notificationMessage.notificationData.length !== 0) {
|
|
306
|
+
this.acknowledge_notification(subscriptionId, notificationMessage.sequenceNumber);
|
|
307
|
+
}
|
|
308
|
+
// else {
|
|
309
|
+
// this is a keep-alive notification
|
|
310
|
+
// in this case , we shall not acknowledge notificationMessage.sequenceNumber
|
|
311
|
+
// which is only an information of what will be the future sequenceNumber.
|
|
312
|
+
// }
|
|
313
|
+
const subscription = this.subscriptionMap[subscriptionId];
|
|
314
|
+
if (subscription && this.session !== null) {
|
|
315
|
+
try {
|
|
316
|
+
// delegate notificationData to the subscription callback
|
|
317
|
+
subscription.onNotificationMessage(notificationMessage);
|
|
318
|
+
}
|
|
319
|
+
catch (err) {
|
|
320
|
+
if (doDebug) {
|
|
321
|
+
debugLog(err);
|
|
322
|
+
debugLog("Exception in onNotificationMessage");
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
debugLog(" ignoring notificationMessage", notificationMessage, " for subscription", subscriptionId);
|
|
328
|
+
debugLog(" because there is no subscription.");
|
|
329
|
+
debugLog(" or because there is no session for the subscription (session terminated ?).");
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
_republish(subscription, subscriptionId, callback) {
|
|
333
|
+
(0, node_opcua_assert_1.assert)(subscription.subscriptionId === +subscriptionId);
|
|
334
|
+
let isDone = false;
|
|
335
|
+
const session = this.session;
|
|
336
|
+
const sendRepublishFunc = (callback2) => {
|
|
337
|
+
(0, node_opcua_assert_1.assert)(isFinite(subscription.lastSequenceNumber) && subscription.lastSequenceNumber + 1 >= 0);
|
|
338
|
+
const request = new node_opcua_service_subscription_1.RepublishRequest({
|
|
339
|
+
retransmitSequenceNumber: subscription.lastSequenceNumber + 1,
|
|
340
|
+
subscriptionId: subscription.subscriptionId
|
|
341
|
+
});
|
|
342
|
+
// istanbul ignore next
|
|
343
|
+
if (doDebug) {
|
|
344
|
+
debugLog(chalk.bgCyan.yellow.bold(" republish Request for subscription"), request.subscriptionId, " retransmitSequenceNumber=", request.retransmitSequenceNumber);
|
|
345
|
+
}
|
|
346
|
+
if (!session || session._closeEventHasBeenEmitted) {
|
|
347
|
+
debugLog("ClientPublishEngine#_republish aborted ");
|
|
348
|
+
// has client been disconnected in the mean time ?
|
|
349
|
+
isDone = true;
|
|
350
|
+
return callback2();
|
|
351
|
+
}
|
|
352
|
+
session.republish(request, (err, response) => {
|
|
353
|
+
const statusCode = err ? node_opcua_status_code_1.StatusCodes.Bad : response.responseHeader.serviceResult;
|
|
354
|
+
if (!err && (statusCode.equals(node_opcua_status_code_1.StatusCodes.Good) || statusCode.equals(node_opcua_status_code_1.StatusCodes.BadMessageNotAvailable))) {
|
|
355
|
+
// reprocess notification message and keep going
|
|
356
|
+
if (statusCode.equals(node_opcua_status_code_1.StatusCodes.Good)) {
|
|
357
|
+
subscription.onNotificationMessage(response.notificationMessage);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
if (!err) {
|
|
362
|
+
err = new Error(response.responseHeader.serviceResult.toString());
|
|
363
|
+
}
|
|
364
|
+
debugLog(" _send_republish ends with ", err.message);
|
|
365
|
+
isDone = true;
|
|
366
|
+
}
|
|
367
|
+
callback2(err ? err : undefined);
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
setImmediate(() => {
|
|
371
|
+
(0, node_opcua_assert_1.assert)(typeof callback === "function");
|
|
372
|
+
async.whilst((cb) => cb(null, !isDone), sendRepublishFunc, ((err) => {
|
|
373
|
+
debugLog("nbPendingPublishRequest = ", this.nbPendingPublishRequests);
|
|
374
|
+
debugLog(" _republish ends with ", err ? err.message : "null");
|
|
375
|
+
callback(err);
|
|
376
|
+
}) // Wait for @type/async bug to be fixed !
|
|
377
|
+
);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
__repairSubscription(subscription, subscriptionId, callback) {
|
|
381
|
+
debugLog("__repairSubscription for SubscriptionId ", subscriptionId);
|
|
382
|
+
this._republish(subscription, subscriptionId, (err) => {
|
|
383
|
+
(0, node_opcua_assert_1.assert)(!err || err instanceof Error);
|
|
384
|
+
debugLog("__repairSubscription--------------------- err =", err ? err.message : null);
|
|
385
|
+
if (err && err.message.match(/BadSessionInvalid/)) {
|
|
386
|
+
// _republish failed because session is not valid anymore on server side.
|
|
387
|
+
return callback(err);
|
|
388
|
+
}
|
|
389
|
+
if (err && err.message.match(/SubscriptionIdInvalid/)) {
|
|
390
|
+
// _republish failed because subscriptionId is not valid anymore on server side.
|
|
391
|
+
//
|
|
392
|
+
// This could happen when the subscription has timed out and has been deleted by server
|
|
393
|
+
// Subscription may time out if the duration of the connection break exceed the max life time
|
|
394
|
+
// of the subscription.
|
|
395
|
+
//
|
|
396
|
+
// In this case, Client must recreate a subscription and recreate monitored item without altering
|
|
397
|
+
// the event handlers
|
|
398
|
+
//
|
|
399
|
+
debugLog(chalk.bgWhite.red("_republish failed " + " subscriptionId is not valid anymore on server side."));
|
|
400
|
+
const subscriptionI = subscription;
|
|
401
|
+
return subscriptionI.recreateSubscriptionAndMonitoredItem(callback);
|
|
402
|
+
}
|
|
403
|
+
callback();
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
ClientSidePublishEngine.publishRequestCountInPipeline = 5;
|
|
408
|
+
exports.ClientSidePublishEngine = ClientSidePublishEngine;
|
|
409
|
+
//# sourceMappingURL=client_publish_engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client_publish_engine.js","sourceRoot":"","sources":["../../source/private/client_publish_engine.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,+BAA+B;AAC/B,+BAA+B;AAC/B,yDAA2C;AAC3C,uDAAkF;AAClF,qFAAuH;AACvH,mEAAqD;AAOrD,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,OAAO,GAAG,IAAA,iCAAc,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,IAAA,kCAAe,EAAC,UAAU,CA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