ERR_STREAM_WRAP


如果在套接字上设置了字符串解码器或解码器在 objectMode 中,则防止中止。

const Socket = require('node:net').Socket;
const instance = new Socket();

instance.setEncoding('utf8');

Prevents an abort if a string decoder was set on the Socket or if the decoder is in objectMode.

const Socket = require('node:net').Socket;
const instance = new Socket();

instance.setEncoding('utf8');