You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 23, 2019. It is now read-only.
a low priority dial to the provided peer. Calls to `dial` and `dialFSM` will take priority. This should be used when an application only wishes to establish connections to new peers, such as during peer discovery when there is a low peer count. Currently, anything greater than the HIGH_PRIORITY (10) will be placed into the cold call queue, and anything less than or equal to the HIGH_PRIORITY will be added to the normal queue.
159
+
160
+
- `peer`: can be an instance of [PeerInfo][], [PeerId][] or [multiaddr][]
161
+
- `options`: Optional
162
+
- `options.priority`: Number of the priority of the dial, defaults to 20.
163
+
- `options.useFSM`: Boolean of whether or not to callback with a [Connection State Machine](#connection-state-machine)
164
+
- `callback`: Function with signature `function (err, connFSM) {}` where `connFSM` is a [Connection State Machine](#connection-state-machine)
165
+
156
166
##### Events
157
167
- `error`: emitted whenever a fatal error occurs with the connection; the error will be emitted.
158
168
- `error:upgrade_failed`: emitted whenever the connection fails to upgrade with a muxer, this is not fatal.
@@ -187,7 +197,17 @@ Emitted when the switch encounters an error.
187
197
188
198
### `switch.on('peer-mux-closed', (peer) => {})`
189
199
190
-
- `peer`: is instance of [PeerInfo][] that has info of the peer we have just closed a muxed connection.
200
+
- `peer`: is instance of [PeerInfo][] that has info of the peer we have just closed a muxed connection with.
201
+
202
+
### `switch.on('connection:start', (peer) => {})`
203
+
This will be triggered anytime a new connection is created.
204
+
205
+
- `peer`: is instance of [PeerInfo][] that has info of the peer we have just started a connection with.
206
+
207
+
### `switch.on('connection:end', (peer) => {})`
208
+
This will be triggered anytime an existing connection, regardless of state, is removed from the switch's internal connection tracking.
209
+
210
+
- `peer`: is instance of [PeerInfo][] that has info of the peer we have just closed a connection with.
0 commit comments