How to use the node-opcua-service-discovery.RegisterServerRequest function in node-opcua-service-discovery

To help you get started, we’ve selected a few node-opcua-service-discovery 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 / register_server_manager.ts View on Github external
function constructRegisterServerRequest(
  server: any,
  isOnline: boolean
): RegisterServerRequest {

    const discoveryUrls = server.getDiscoveryUrls();
    assert(!isOnline || discoveryUrls.length >= 1, "expecting some discoveryUrls if we go online ....");

    return new RegisterServerRequest({

        server: {
            // The globally unique identifier for the Server instance. The serverUri matches
            // the applicationUri from the ApplicationDescription defined in 7.1.
            serverUri: server.serverInfo.applicationUri,

            // The globally unique identifier for the Server product.
            productUri: server.serverInfo.productUri,
            serverNames: [
                { locale: "en", text: server.serverInfo.productName }
            ],
            serverType: server.serverType,

            discoveryUrls,
            gatewayServerUri: null,
            isOnline,