muellmusik / Utopia

This is an attempt at a generic library of tools for making Network Music Apps in SuperCollider
43 stars 8 forks source link

Hail only adds peers when a reply is received. Is this correct? #6

Closed muellmusik closed 9 years ago

muellmusik commented 9 years ago

Hail only adds peers when a reply to its own hailing signal is received, not when it receives a hailing signal.

Changing it so that it did the latter might make AddrBook population more robust when SC has more than one network interface available. The problem can be described as follows:

This sort of situation is one reason (the only?) for the 'invisible machine' problem, and also WARNING: CodeRelay access attempt from unrecognised addr: a NetAddr(192.168.0.101, 57120) and similar warnings.

So would it cause problems to have Hail add Peers when a hailing message is received (and also count those for online status)?

Or (maybe better) use a range of test broadcast addresses, e.g. instead of just 255.255.255.255, perhaps instead/also hail to 192.255.255.255 and 147.255.255.255. This would cover all normal LAN ranges, or?

muellmusik commented 9 years ago

Come to think of it, I'm not entirely sure why I decided to have separate hail and hail reply signals. In principle a peer's hails could be equivalent to replies.

muellmusik commented 9 years ago

Or (maybe better) use a range of test broadcast addresses, e.g. instead of just 255.255.255.255, perhaps instead/also hail to 192.255.255.255 and 147.255.255.255. This would cover all normal LAN ranges, or?

Sorry talking rubbish, 147... is of course not local 192.168... is and 10... and 169.254...

muellmusik commented 9 years ago

Okay, we actually need the replies to fully solve this. I tried the multiple broadcast approach, but that was a bit ugly as unreachable broadcast addresses cause an error to be thrown.

So the best solution is to update peer info both when a hail received, and when a reply to a hail is received. That way we always find out about everyone, providing broadcast works in at least one direction.

muellmusik commented 9 years ago

Okay, tested and worked on a multi-network interface setup

muellmusik commented 9 years ago

Anyone had a chance to test this?

muellmusik commented 9 years ago

Fixed with PR #7