Closed robinbowes closed 2 months ago
Robin, it has been a while since I've looked at this, and I realized that I only ever tested it with a single device at a time. I will try to take a look in the next couple of days to see if I can shed any light on it.
John
-------- Original Message --------
On 2024-06-02 19:59, Robin Bowes wrote:
Hi @jcrummy,
I was going to re-write my net-udap tool in go, then discovered that you'd already done it!
I've forked your repo and am testing your sbconfig utility.
I've found a problem when I have more than one device on the network.
The Sb struct seems to get populated OK when the handler function fires, but when appended to the sb slice, all items in the slice seem to end up with the same Mac.
For example, I have two receivers and my laptop has both wired and wireless connections so I get four responses when I do a UDAP discover, as each receiver receives a two broadcasts - one on wired, and one on wireless. I've added print commands to print the foundSB struct, and the whole sb slice after each response is processed. As you can see, after each response is processed, all the items in the sb slice seem to have the MAC address of the most recentlly processed response:
{MacAddr:00:04:20:16:06:02 IPAddr:
Robin, it has been a while since I've looked at this, and I realized that I only ever tested it with a single device at a time. I will try to take a look in the next couple of days to see if I can shed any light on it. John
Thanks John!
I did a bit more digging, and it seems to be that the Mac Address that is used to create the foundSB
object some how persists between invocations of the handler function, so all Sb
objects in the slice end up being the same one, which is why they have the same Mac Address.
I'm pretty new to Go so I don't understand how/why this is happening, or how to fix it.
I shall keep digging.
@robinbowes thank you for digging in to this.
One thing to keep in mind when looking at this repo is that I wrote this when I was learning Go myself, so I would not consider this to be done in an enigmatic Go fashion (it is more of a mix of Perl and Go as far as styles go). It has been in the back of my head to refactor it for a while now, but I haven't had to reconfigure any of my players for quite some time, so it just hasn't been a high priority.
@robinbowes thank you for digging in to this.
One thing to keep in mind when looking at this repo is that I wrote this when I was learning Go myself, so I would not consider this to be done in an enigmatic Go fashion (it is more of a mix of Perl and Go as far as styles go). It has been in the back of my head to refactor it for a while now, but I haven't had to reconfigure any of my players for quite some time, so it just hasn't been a high priority.
Understood.
I'm working on a Go UDAP protocol implementation that will be based on the SqueezePlay implementation here: https://github.com/LMS-Community/squeezeplay/tree/f4c243e3eb5dca051a3bcb122771b19586744bab/src/squeezeplay/share/jive/net
I'm mostly doing it as an exercise in learning Go!
Thanks for merging my PR.
R.
Hi @jcrummy,
I was going to re-write my net-udap tool in go, then discovered that you'd already done it!
I've forked your repo and am testing your sbconfig utility.
I've found a problem when I have more than one device on the network.
The
Sb
struct seems to get populated OK when the handler function fires, but when appended to thesb
slice, all items in the slice seem to end up with the same Mac.For example, I have two receivers and my laptop has both wired and wireless connections so I get four responses when I do a UDAP discover, as each receiver receives a two broadcasts - one on wired, and one on wireless. I've added print commands to print the
foundSB
struct, and the wholesb
slice after each response is processed. As you can see, after each response is processed, all the items in thesb
slice seem to have the MAC address of the most recentlly processed response:Any idea what's going on? I've tried to figure it out but it's got me stumped.
Thanks,
R.