js-libp2p
js-libp2p copied to clipboard
[switch] start and stop accepting connections
For each different transport individually, in order to do connection throttling, it's important to be able to start and stop the listener by command of the user.
Also depends on fixing these issues:
- [ ] https://github.com/libp2p/js-libp2p-websocket-star/issues/49
- [ ] https://github.com/libp2p/js-libp2p-tcp/issues/92
Also the UTP transport has the same issue:
- [ ] https://github.com/libp2p/js-libp2p-utp/issues/76
@diasdavid there's an incongruence in the interface-transport docs:
options is an optional object that might contain the following properties:
- timeout - A timeout value (in ms) that fires and destroys all the connections on this transport if the transport is not able to close graciously. (e.g { timeout: 1000 })
We will also need to remove/change the interface-stream-muxer test at https://github.com/libp2p/interface-stream-muxer/blob/v0.5.9/src/close-test.js#L37, as it expects the muxer connections to close when the listener is closed. Instead it should validate the connection is still usable.