Answer the question
In order to leave comments, you need to log in
What is the meaning of the example line in the node.js documentation?
Example from documentation:
nodejs.org/api/net.html#net_net_createserver_optio...
var net = require('net');
var server = net.createServer(function(c) { //'connection' listener
console.log('server connected');
c.on('end', function() {
console.log('server disconnected');
});
c.write('hello\r\n');
c.pipe(c);
});
c.pipe(c);
Answer the question
In order to leave comments, you need to log in
This makes sense if the stream is Duplex, i.e. both Readable and Writeable.
For example tcp socket, then this entry is c.pipe(c); means receive data and send back.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question