node-opcua-transport
Version:
pure nodejs OPCUA SDK - module transport
47 lines (45 loc) • 1.13 kB
TypeScript
/**
* @module node-opcua-transport
*/
import type { ErrorCallback } from "node-opcua-status-code";
import { ClientTransportBase } from "./client_transport_base";
import type { TransportSettingsOptions } from "./i_client_transport";
export type { TransportSettingsOptions };
/**
* a ClientTCP_transport connects to a remote server socket and
* initiates a communication with a HEL/ACK transaction.
* It negotiates the communication parameters with the other end.
* @example
*
* ```javascript
* const transport = ClientTCP_transport(url);
*
* transport.timeout = 10000;
*
* transport.connect(function (err)) {
* if (err) {
* // cannot connect
* } else {
* // connected
*
* }
* });
* ....
*
* transport.write(message_chunk, 'F');
*
* ....
*
* transport.on("chunk", function (message_chunk) {
* // do something with chunk from server...
* });
*
*
* ```
*
*
*/
export declare class ClientTCP_transport extends ClientTransportBase {
dispose(): void;
connect(endpointUrl: string, callback: ErrorCallback): void;
}