0
读取net
模块的Node.js文档我可以看到用于net.connect
和net.createConnection
的文本完全相同。事实上,在net.createConnection
中使用的示例使用net.connect
。Node.js网络模块文档错误
这是文档错误吗? net.connect
和net.createConnection
之间有什么区别?
谢谢。
读取net
模块的Node.js文档我可以看到用于net.connect
和net.createConnection
的文本完全相同。事实上,在net.createConnection
中使用的示例使用net.connect
。Node.js网络模块文档错误
这是文档错误吗? net.connect
和net.createConnection
之间有什么区别?
谢谢。
根据他们做同样的事情在Node.js source code:
exports.connect = exports.createConnection = function() {
它们是@lxe提到,'net.createConnection()'是两个上了年纪也比较罗嗦完全相同的功能。我已经提交了一个PR来解决这个例子[这里](https://github.com/nodejs/node/pull/5219)。 – mscdex