docs: update readme for array listen

License: MIT
Signed-off-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
Jacob Heun 2019-04-19 10:47:18 +02:00
parent 9d5ccd17a2
commit 330853f470
No known key found for this signature in database
GPG Key ID: CA5A94C15809879F

View File

@ -44,7 +44,7 @@ const multiaddr = require('multiaddr')
const pipe = require('it-pipe')
const { collect } = require('streaming-iterables')
const mh = multiaddr('/ip4/127.0.0.1/tcp/9090')
const addr = multiaddr('/ip4/127.0.0.1/tcp/9090')
const tcp = new TCP()
@ -56,10 +56,10 @@ const listener = tcp.createListener((socket) => {
)
})
await listener.listen(mh)
await listener.listen([addr])
console.log('listening')
const socket = await tcp.dial(mh)
const socket = await tcp.dial(addr)
const values = await pipe(
socket,
collect