TypeError: Object #<Socket> has no method 'destory'

TypeError: Object #<Socket> has no method 'destory'

我在 node.js 中处理来自 net.createConnection 的 ECONNREFUSED 错误时遇到问题。

当我连接时,我得到 ECONREFUSED(这很好),我这样处理:

testSocket.addListener('error', function(message) {
    testSocket.destory();
});

然后出现错误:TypeError: Object # has no method 'destory'.

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

提前致谢!

您是说 destroy 吗?你拼错了(distORy)