-
Notifications
You must be signed in to change notification settings - Fork 17
Why poll? #70
Comments
@whyrusleeping @diasdavid @Stebalien please comment |
@richardschneider are you sure? If thats the case, then we could remove the polling. I would like to see it working in practice without polling before I would be okay disabling it though |
@whyrusleeping added a test to PR #71
|
That sounds correct however, it doesn't handle the case of joining/leaving networks. Ideally, libp2p would expose an API to monitor for new network addresses (I want this so badly) but implementing this properly is a pain (although we should have something that just does this on a timer anyways...). For now, maybe poll once every 10 minutes, every half hour? That should at least cover the case of "close laptop, move elsewhere, open laptop, discover peers". |
Btw, sleeptime has a typo that prevents custom intervals from working (timrach/sleeptime#1) and breaks if the application does too much work on it's main thread (edit: with break i mean that it does trigger even if the laptop wasn't asleep) (edit2: could be fixed by using |
@mkg20001 Thank's for the heads-up. I assume that 'breaking' (false positives) is dependent on the |
Also, sleeptime needs a |
@richardschneider that's a fair point but, in go at least, have a server profile that disables mdns for this reason. Also, I'd hope that most datacenters turn of multicast (or at least multicaset between multiple customers). In go-libp2p, we have a Note: this still won't handle cases of networks joining each other but... that's not exactly a common case that I care about. |
I think I read in the MDNS RFC that mutlicasting is for the local network and not joined networks, but I could be wrong. |
I was thinking about network partitions. If my network gets partitioned, I join, and then it gets unpartitioned, I will never advertise myself to the other partition. However, on local networks this is really not that much of an issue. |
@richardschneider I have created a rewritten version of sleeptime (https://github.com/mkg20001/sleeptime2) that fixes that issue and the other I mentioned above |
@mkg20001 |
@richardschneider The IPC is one of nodes core apis so it should work on windows. |
A |
To paraphrase Jörgen Sigvardsson
|
Every 10 seconds a multicast query is sent. I assume it is done to find new IPFS peers.
Every time a new peer starts, it will send a query and ALSO respond to it with it's info.
Since this is multicast, all other nodes will see its response and add the peer to it's tables.
So polling every 10s is not needed.
The text was updated successfully, but these errors were encountered: