I'm a bit confused about when I should be creating a new LocalDevice instance and when I should be re-using the same in the scenario where there are multiple RemoteDevices I'm interesting in communicating with.
I've laid out a scenario here that seems to be working well enough:
But now I'm unsure what the right approach is to add another "set" of devices that are reached through the main device. I'm confused because in order to discover these devices I had to register with the remote device as a Foreign Device. This works well enough and when I use the device discoverer I see all of the devices.
The problem is - when I need to add a 2nd or 3rd set of these, I'm already registered as a FD with the first one, and IpNetwork blows up if you try to register again.
Does that mean I should be using a new LocalDevice instance? Should it be bound to the same network adapter/IP? Bound to the same port?
I've played around with multiple LocalDevices bound to the same IP/port, with different device ids, but kept seeing weird behavior where one or the other didn't seem to receive messages.