Session
A wrapper around node-opcua~ClientSession used to connect to atvise server. The sessions currentyl being opened.
Test:
Static Member Summary
Static Public Members | ||
public static get |
The sessions currently open. |
Static Private Members | ||
private static |
_createShared: Promise<node-opcua~ClientSession A promise that resolves once the shared session is created. |
|
private static |
If sessions should be reused. |
Static Method Summary
Static Public Methods | ||
public static |
close(session: node-opcua~ClientSession): Promise<node-opcua~ClientSession, Error> Closes the given session. |
|
public static |
Closes all open sessions. |
|
public static |
Creates an node-opcuaOPCUAClient and opens a new node-opcua~ClientSession. |
|
public static |
pool() Starts pooling (reusing) sessions. |
Static Private Methods | ||
private static |
async _close(session: node-opcua~ClientSession): Promise<node-opcua~ClientSession, Error> Closes the given session. |
|
private static |
async _create(): Promise<node-opcua~ClientSession, Error> Creates an node-opcuaOPCUAClient and opens a new node-opcua~ClientSession. |
Static Public Members
public static get open: Session[] source
The sessions currently open. Starting with version 1.0.0-beta.25 there will be one at most.
Static Private Members
private static _createShared: Promise<node-opcua~ClientSession source
A promise that resolves once the shared session is created.
Static Public Methods
public static close(session: node-opcua~ClientSession): Promise<node-opcua~ClientSession, Error> source
Closes the given session. When session pooling is active the session won't actually be closed and the returned Promise will resolve immediately.
Params:
Name | Type | Attribute | Description |
session | node-opcua~ClientSession | The session to close. |
Return:
Promise<node-opcua~ClientSession, Error> | Fulfilled with the (maybe closed) session or rejected with the error that occured while closing. |
Test:
public static async closeOpen(): Promise<Error, Session[]> source
Closes all open sessions.
Return:
Promise<Error, Session[]> | Rejected with the error that occurred while closing the sessions or fulfilled with the (now closed) sessions affected. |
Test:
public static create(): Promise<node-opcua~ClientSession, Error> source
Creates an node-opcuaOPCUAClient and opens a new node-opcua~ClientSession. If pooling is active, the shared session will be reused.
Return:
Promise<node-opcua~ClientSession, Error> | Fulfilled with an already opened node-opcua~ClientSession. |
Test:
public static pool() source
Starts pooling (reusing) sessions. Note that you'll have to manually close sessions using Session.closeOpen.
Static Private Methods
private static async _close(session: node-opcua~ClientSession): Promise<node-opcua~ClientSession, Error> source
Closes the given session. Waits for currently opening sessions to open.
Params:
Name | Type | Attribute | Description |
session | node-opcua~ClientSession | The session to close. |
Return:
Promise<node-opcua~ClientSession, Error> | Fulfilled with the (now closed!) session or rejected with the error that occured while closing. |
private static async _create(): Promise<node-opcua~ClientSession, Error> source
Creates an node-opcuaOPCUAClient and opens a new node-opcua~ClientSession.
Return:
Promise<node-opcua~ClientSession, Error> | Fulfilled with an already opened node-opcua~ClientSession. |