mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-04-25 12:42:24 +00:00
feat(spec): update the dial interface to cope with new pull additions
This commit is contained in:
parent
02b3210806
commit
2e12166ba8
@ -62,8 +62,6 @@ A valid (read: that follows the interface defined) transport, must implement the
|
|||||||
- type: `Transport`
|
- type: `Transport`
|
||||||
- `new Transport([options])`
|
- `new Transport([options])`
|
||||||
- `transport.dial(multiaddr, [options, callback])`
|
- `transport.dial(multiaddr, [options, callback])`
|
||||||
- event: 'connect'
|
|
||||||
- event: 'error'
|
|
||||||
- `transport.createListener([options], handlerFunction)`
|
- `transport.createListener([options], handlerFunction)`
|
||||||
- type: `transport.Listener`
|
- type: `transport.Listener`
|
||||||
- event: 'listening'
|
- event: 'listening'
|
||||||
@ -96,12 +94,7 @@ This method dials a transport to the Peer listening on `multiaddr`.
|
|||||||
|
|
||||||
`callback` should follow the `function (err, conn)` signature.
|
`callback` should follow the `function (err, conn)` signature.
|
||||||
|
|
||||||
`conn` is the same `conn` that gets returned by call, which should follow [`interface-connection`](https://github.com/diasdavid/interface-connection). This `conn` object can emit 3 extra events:
|
`conn` is the same `conn` that gets returned by call, which should follow [`interface-connection`](https://github.com/diasdavid/interface-connection). `err` is an `Error` instance to signal that the dial was unsuccessful, this error can be a 'timeout' or simply 'error'.
|
||||||
|
|
||||||
- `connect` -
|
|
||||||
- `timeout` -
|
|
||||||
- `error` -
|
|
||||||
|
|
||||||
|
|
||||||
### Create a listener
|
### Create a listener
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user