How to use the node-opcua-service-session.CreateSessionResponse function in node-opcua-service-session

To help you get started, we’ve selected a few node-opcua-service-session 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-secure-channel / test_helpers / mock / mock_transport.ts View on Github external
createdAt: new Date(), // now
        revisedLifetime: 30000,
        tokenId: 1,
    },
    serverNonce: Buffer.from("qwerty")
});

export const fakeGetEndpointsResponse = new GetEndpointsResponse({
    endpoints: [
        {
            endpointUrl: "fake://localhost:2033/SomeAddress"
        }
    ]
});

export const fakeCreateSessionResponse = new CreateSessionResponse({});
export const fakeActivateSessionResponse = new ActivateSessionResponse({});

export class MockServerTransport extends EventEmitter {

    private _replies: any;
    private _mockTransport: DirectTransport;
    private _counter: number;

    constructor(expectedReplies: any) {

        super();

        this._replies = expectedReplies;
        this._counter = 0;

        this._mockTransport = new DirectTransport();