On Thu, Dec 20, 2018, 4:47 PM Mats Wichmann <m...@wichmann.us wrote: > On 12/20/18 3:32 PM, Gregg Reynolds wrote: > > Have been looking at nw monitoring code. > > > > It's astoundingly complicated. But in the end, I see one thing happening > > for all transports: update the list of local endpoints. For TCP there's > > more, because of cloud, but it is not yet implementated. > > > > On my analysis we can eliminate almost all of this code. E.g. there's a > lot > > of code devoted to maintaining an interface list. Which is never actually > > used. Example: > > CAIPGetInterfaceInformation > > > > is a waste of time and can be eliminated. Again, the interface list it > > maintains serves no purpose afaik, so can be eliminated. > > this code seems to be more complicated than it needs to almost anywhere. > > asking a lot, but are you able to tell if: this was an attempt to start > implementing interfaces, which then turned out to be the wrong way and > was thus not pursued; or if there should be interface lists but iotivity > doesn't implement them properly?
Third option: the "interface" code is simply not needed. The whole point afaik is to refresh the local ep list. We do not need an iflist to do that. Just getifaddrs and refresh the local ep list from that. By my analysis the iflist global serves no purpose. Fwiw I've eliminated all this code in openocf and it seems to work. The details are a little hairy, but that's kinda the point. The current code is wildly over-engineered, to the point of being incomprehensible. >From my previous life I seem to recall > there was a mismatch between where the OCF specs were going with > interfaces (at least "default interface"), and what iotivity did; I > don't know if that ever got resolved. > > interfaces as envisioned by OCF are a stretch in applying the concept > you see in some object-oriented languages to the OCF API model, and > didn't ever get explained well. but that's just my opinion as an > outsider-gadfly type these days :) > See, here's a problem. OCF does not do interfaces. Its a protocol. "Interfaces" are an implemetation detail. Iotivity has a very wierd quasi-OO notion of interface. In any case OCF should have no truck with interfaces. G > > > -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#10087): https://lists.iotivity.org/g/iotivity-dev/message/10087 Mute This Topic: https://lists.iotivity.org/mt/28815690/21656 Group Owner: iotivity-dev+ow...@lists.iotivity.org Unsubscribe: https://lists.iotivity.org/g/iotivity-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-