Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 类型错误:对象#<;插座>;没有方法';破坏性';_Node.js_Sockets_Destroy - Fatal编程技术网

Node.js 类型错误:对象#<;插座>;没有方法';破坏性';

Node.js 类型错误:对象#<;插座>;没有方法';破坏性';,node.js,sockets,destroy,Node.js,Sockets,Destroy,我在处理node.js中net.createConnection的EconnReclused错误时遇到问题 当我连接时,我会被拒绝(这很好),我会这样处理: testSocket.addListener('error', function(message) { testSocket.destory(); }); 这就给了我一个错误:TypeError:Object#没有“destory”方法 我的目标是根据错误关闭套接字,然后启动重新连接过程 提前谢谢 你是说销毁?你拼错了(distO

我在处理node.js中net.createConnection的EconnReclused错误时遇到问题

当我连接时,我会被拒绝(这很好),我会这样处理:

testSocket.addListener('error', function(message) {
    testSocket.destory();
});
这就给了我一个错误:TypeError:Object#没有“destory”方法

我的目标是根据错误关闭套接字,然后启动重新连接过程


提前谢谢

你是说
销毁
?你拼错了(
distORy

哇,我盯着这条路看了很久!谢谢你的接球!发生在我们所有人身上;)