From 2dc52d0a5c4e4042910a4cf0f9953ceb52600364 Mon Sep 17 00:00:00 2001 From: Evan Schwartz Date: Wed, 3 Aug 2016 17:52:01 +0200 Subject: [PATCH] docs: fix README example --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1e3d2ce..c6a428b 100644 --- a/README.md +++ b/README.md @@ -30,23 +30,22 @@ const multiaddr = require('multiaddr') const mh1 = multiaddr('/ip4/127.0.0.1/tcp/9090') const mh2 = multiaddr('/ip6/::/tcp/9092') -const tcp = new Tcp() +const tcp = new TCP() var listener = tcp.createListener(mh1, function handler (socket) { console.log('connection') socket.end('bye') }) -var listener.listen(function ready () { +listener.listen(mh1, function ready () { console.log('ready') const client = tcp.dial(mh1) client.pipe(process.stdout) client.on('end', () => { - tcp.close() + listener.close() }) }) - ``` outputs