我想通过节点js客户端连接opc-ua服务器。但是我收到错误消息,例如套接字已被第三方断开连接 在ClientTCP_transport.TCP_transport._on_socket_ended_message(/home/samit/node-project/node_modules/node-opcua-transport/src/tcp_transport.js:267:18)
var opcua = require("node-opcua");
var async = require("async");
var client = new opcua.OPCUAClient();
var endpointUrl = "opc.tcp://localhost:62541";
var the_session, the_subscription;
async.series([
function(callback) {
client.connect(endpointUrl,function (err) {
if(err) {
console.log(" cannot connect to endpoint :", endpointUrl );
} else {
console.log("connected !");
}
callback(err);
});
}
],
function(err) {
if (err) {
console.log(" failure ",err);
} else {
console.log("done!");
}
client.disconnect(function(){});
}) ;