You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by "splatch (via GitHub)" <gi...@apache.org> on 2023/06/14 11:51:40 UTC

Re: [D] Handling Protocols that require fixed communication coordinates? (plc4x)

GitHub user splatch added a comment to the discussion: Handling Protocols that require fixed communication coordinates?

I am not entirely sure what you mean by fixed communication coordinate - a network/serial/raw socket and access to it or static addresses?

For first we could have a multiplexing layer if we would netty internals and limit transports to rely only on input and output streams (or buffers). It won't be easy since access to buffers is down to byte and not message level, plus we would need to understand received packets before routing to internal receiver.  Going that route is difficult as it requires redesign of transports but also making protocol frame detection logic re-usable elsewhere.

Back at the time when I was messing with ADS discovery I made a separate UDP listener/emitter which was singleton started aside of driver. This listener provided methods to register packet listeners and emitter allowed to send outgoing message. I did revisit this design recently and generalized it even further to a broadcaster and requester, each having a bit different signatures but ultimately relying on some sort of destination address and `byte[]` sent (or received) from it.

Use of statics is no-go for OSGi for sure, however many of its pitfalls can be avoided with basic interfaces which can be implemented according to OSGi runtime needs.

GitHub link: https://github.com/apache/plc4x/discussions/949#discussioncomment-6173986

----
This is an automatically sent email for dev@plc4x.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@plc4x.apache.org