go-libp2p-daemon
go-libp2p-daemon copied to clipboard
Network notifiee callbacks
I'm thinking if it makes sense to let the daemon register a network notifiee which has both Connected
and Disconnected
exposed to the clients in some way(e.g. through the socket which the client is listening). It will allow the clients to be called back right after connected and disconnected events. This is not necessary because we can do it through polling with list_peers
.
The advantage I can think of now is we can perform handshaking or blacklist checking right after connecting, and be updated when peers have disconnected. The drawback is that it incurs additional complexity to do the callbacks in both the daemon and client.
Yeah, connection notifications are probably very useful. We can add a relevant interface, although it is a little complex to implement.