go-libp2p-daemon icon indicating copy to clipboard operation
go-libp2p-daemon copied to clipboard

Network notifiee callbacks

Open mhchia opened this issue 5 years ago • 1 comments

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.

mhchia avatar Mar 20 '19 09:03 mhchia

Yeah, connection notifications are probably very useful. We can add a relevant interface, although it is a little complex to implement.

vyzo avatar Mar 20 '19 10:03 vyzo