summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpkcs <pkcs@gmx.com>2014-11-24 00:54:21 +0100
committerJulien Gilli <julien.gilli@joyent.com>2014-12-08 15:23:22 -0800
commit8120015f4078e05ad350bb71b2839f1ce7bbc7f9 (patch)
tree8277271053e49d2a853b221262d146d8cc3b1562
parentf5cb330ab13de7d80aac6891f07abcb1b73da615 (diff)
downloadnode-8120015f4078e05ad350bb71b2839f1ce7bbc7f9.tar.gz
doc: clearer log messages in net code samples
Code examples in documentation for net.createServer and net.createConnection contained confusing log messages. This change makes them clearer. Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
-rw-r--r--doc/api/net.markdown8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/api/net.markdown b/doc/api/net.markdown
index f7f044d87..4fdcef421 100644
--- a/doc/api/net.markdown
+++ b/doc/api/net.markdown
@@ -26,9 +26,9 @@ on port 8124:
var net = require('net');
var server = net.createServer(function(c) { //'connection' listener
- console.log('server connected');
+ console.log('client connected');
c.on('end', function() {
- console.log('server disconnected');
+ console.log('client disconnected');
});
c.write('hello\r\n');
c.pipe(c);
@@ -86,7 +86,7 @@ Here is an example of a client of echo server as described previously:
var net = require('net');
var client = net.connect({port: 8124},
function() { //'connect' listener
- console.log('client connected');
+ console.log('connected to server!');
client.write('world!\r\n');
});
client.on('data', function(data) {
@@ -94,7 +94,7 @@ Here is an example of a client of echo server as described previously:
client.end();
});
client.on('end', function() {
- console.log('client disconnected');
+ console.log('disconnected from server');
});
To connect on the socket `/tmp/echo.sock` the second line would just be