【问题标题】:The class net.Stream is not discussed in Node.js' documentation but is being used for node-postgres类 net.Stream 没有在 Node.js 的文档中讨论,但被用于 node-postgres
【发布时间】:2016-07-15 17:01:27
【问题描述】:

https://github.com/brianc/node-postgres/blob/master/lib/connection.js

var net = require('net');
var Connection = function(config) {
  ...
  config = config || {};
  this.stream = config.stream || new net.Stream();
  ...
}

文档中根本没有提到 net.Stream 。 https://nodejs.org/api/net.html

我错过了什么吗?

【问题讨论】:

    标签: node.js postgresql


    【解决方案1】:

    看起来它只是Socket 的别名。

    exports.Stream = Socket; // Legacy naming.
    

    来源:https://github.com/nodejs/node/blob/master/lib/net.js#L295

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-19
      • 2016-07-06
      • 1970-01-01
      • 1970-01-01
      • 2015-04-13
      • 2013-10-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多