Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit 2dc52d0

Browse files
committed
docs: fix README example
1 parent e01046e commit 2dc52d0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,22 @@ const multiaddr = require('multiaddr')
3030
const mh1 = multiaddr('/ip4/127.0.0.1/tcp/9090')
3131
const mh2 = multiaddr('/ip6/::/tcp/9092')
3232

33-
const tcp = new Tcp()
33+
const tcp = new TCP()
3434

3535
var listener = tcp.createListener(mh1, function handler (socket) {
3636
console.log('connection')
3737
socket.end('bye')
3838
})
3939

40-
var listener.listen(function ready () {
40+
listener.listen(mh1, function ready () {
4141
console.log('ready')
4242

4343
const client = tcp.dial(mh1)
4444
client.pipe(process.stdout)
4545
client.on('end', () => {
46-
tcp.close()
46+
listener.close()
4747
})
4848
})
49-
5049
```
5150

5251
outputs

0 commit comments

Comments
 (0)