| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
If `false` is not returned a readable stream piped into the socket might continue reading indefinitely until the process goes out of memory.
'use strict';
const net = require('net');
const { Readable } = require('stream');
const chunk = Buffer.alloc(1024);
const readable = new Readable({
read() {
this.push(chunk);
}
});
const server = net.createServer(function(socket) {
server.close();
socket.resume();
setTimeout(function() {
socket.end();
}, 100);
});
server.listen(function() {
const socket = net.connect(this.address().port, function() {
socket.resume();
socket.on('error', function() {});
readable.pipe(socket);
});
}); |
Sorry, something went wrong.
|
Does the documentation for socket.write() need an update to reflect this?
|
Sorry, something went wrong.
|
@Trott I think it's not needed. writeAfterFIN() replaces writeAfterEnd() to give the user a better error message. When writeAfterEnd() is used writable.write() return false. An error is emitted to signal that the write has not been successful. |
Sorry, something went wrong.
Sorry, something went wrong.
If `false` is not returned a readable stream piped into the socket might continue reading indefinitely until the process goes out of memory. PR-URL: #27996 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
If `false` is not returned a readable stream piped into the socket might continue reading indefinitely until the process goes out of memory. PR-URL: #27996 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
| Back | FazBrowse Home | New Git URL |
If false is not returned a readable stream piped into the socket
might continue reading indefinitely until the process goes out of
memory.
Checklist