From ecf2931aade2ef013cd2006c84fdf19aab9be837 Mon Sep 17 00:00:00 2001 From: Kagami Hiiragi Date: Tue, 24 Feb 2015 20:27:41 +0300 Subject: [PATCH] Improve networking usage --- README.md | 4 ++-- lib/net/tcp.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f83afcd..4b38dad 100644 --- a/README.md +++ b/README.md @@ -145,8 +145,8 @@ tcp.bootstrap().then(function(nodes) { tcp.connect(remotePort, remoteHost); }); -tcp.on("established", function() { - console.log("Connection established"); +tcp.on("established", function(version) { + console.log("Connection established to", version.userAgent); tcp.on("message", function(command, payload) { console.log("Got new", command, "message"); diff --git a/lib/net/tcp.js b/lib/net/tcp.js index 7533e3b..ce02b07 100644 --- a/lib/net/tcp.js +++ b/lib/net/tcp.js @@ -18,8 +18,8 @@ * tcp.connect(remotePort, remoteHost); * }); * - * tcp.on("established", function() { - * console.log("Connection established"); + * tcp.on("established", function(version) { + * console.log("Connection established to", version.userAgent); * * tcp.on("message", function(command, payload) { * console.log("Got new", command, "message");