How to use the node-opcua-types.PublishResponse function in node-opcua-types

To help you get started, we’ve selected a few node-opcua-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-server / source / server_publish_engine.ts View on Github external
invalid_published_request.forEach((publishData: any) => {
            console.log(chalk.cyan(" CANCELING TIMEOUT PUBLISH REQUEST "));
            const response = new PublishResponse({
                responseHeader: { serviceResult: StatusCodes.BadTimeout }
            });
            this.send_response_for_request(publishData, response);
        });
    }
github node-opcua / node-opcua / packages / node-opcua-server / source / server_publish_engine.ts View on Github external
assert(!param.hasOwnProperty("availableSequenceNumbers"));
        assert(param.hasOwnProperty("subscriptionId"));
        assert(param.hasOwnProperty("sequenceNumber"));
        assert(param.hasOwnProperty("notificationData"));
        assert(param.hasOwnProperty("moreNotifications"));

        const subscription = this.getSubscriptionById(param.subscriptionId);

        const subscriptionId = param.subscriptionId;
        const sequenceNumber = param.sequenceNumber;
        const notificationData = param.notificationData;
        const moreNotifications = param.moreNotifications;

        const availableSequenceNumbers = subscription ? subscription.getAvailableSequenceNumbers() : [];

        const response = new PublishResponse({
            availableSequenceNumbers,
            moreNotifications,
            notificationMessage: {
                notificationData,
                publishTime: new Date(),
                sequenceNumber
            },
            subscriptionId
        });

        if (this.pendingPublishRequestCount === 0) {
            console.log(
              chalk.bgRed.white.bold(
                " -------------------------------- PUSHING PUBLISH RESPONSE FOR LATE ANSWER !"));

            this._publish_response_queue.push(response);
github node-opcua / node-opcua / packages / node-opcua-server / source / server_publish_engine.ts View on Github external
private send_error_for_request(
      publishData: PublishData,
      statusCode: StatusCode
    ): void {
        _assertValidPublishData(publishData);
        this.send_response_for_request(publishData, new PublishResponse({
            responseHeader: { serviceResult: statusCode }
        }));
    }