You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by "chrisdutz (via GitHub)" <gi...@apache.org> on 2023/09/30 13:06:46 UTC
[D] What is the fireDiscoveryEvent() method in GeneratedDriverBase used for?
GitHub user chrisdutz created a discussion: What is the fireDiscoveryEvent() method in GeneratedDriverBase used for?
Hi all and especially @hutcheb ,
I am currently playing around with implementing Ping operations for all drivers and was going through the code.
There I noticed a type of event "DiscoverEvent" which felt slightly odd.
In the end I noticed that there's a "fireDiscoveryEvent()" method in GeneratedDriverBase and it's implemented to return "false". However it seems as if this is never overridden anywhere ... so it seems as if this always returns "false" for all drivers.
Therefore the code block in DefaultNettyPlcConnection.connect() is also never executed.
I am pretty sure there was a reason for adding this event and code ... but it also seems this doesn't exist anymore.
My question now is:
Is it ok to remove the Event and the event-handling code?
Chris
GitHub link: https://github.com/apache/plc4x/discussions/1123
----
This is an automatically sent email for dev@plc4x.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@plc4x.apache.org
Re: [D] What is the fireDiscoveryEvent() method in GeneratedDriverBase used for?
Posted by "hutcheb (via GitHub)" <gi...@apache.org>.
GitHub user hutcheb added a comment to the discussion: What is the fireDiscoveryEvent() method in GeneratedDriverBase used for?
Looking deeper, it only seems to be necessary when using an encrypted connection (I left a comment in the onDiscover method in SecureChannel), so we can open a non encrypted channel to get the endpoints, and then later we can create an encrypted channel. As that wasn't finished I suppose it's not being used anywhere.
GitHub link: https://github.com/apache/plc4x/discussions/1123#discussioncomment-7153113
----
This is an automatically sent email for dev@plc4x.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@plc4x.apache.org
Re: [D] What is the fireDiscoveryEvent() method in GeneratedDriverBase used for?
Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
GitHub user chrisdutz added a comment to the discussion: What is the fireDiscoveryEvent() method in GeneratedDriverBase used for?
Is it possible, that this was a relic from the PROFINET driver, where you initially executed a discovery in order to connect, which I replaced with an explicit connection and therefore this is no longer needed?
GitHub link: https://github.com/apache/plc4x/discussions/1123#discussioncomment-7151683
----
This is an automatically sent email for dev@plc4x.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@plc4x.apache.org
Re: [D] What is the fireDiscoveryEvent() method in GeneratedDriverBase used for?
Posted by "chrisdutz (via GitHub)" <gi...@apache.org>.
GitHub user chrisdutz added a comment to the discussion: What is the fireDiscoveryEvent() method in GeneratedDriverBase used for?
Well I didn't see the flag actually being set to true anywhere ... that was why I'm asking.
GitHub link: https://github.com/apache/plc4x/discussions/1123#discussioncomment-7152580
----
This is an automatically sent email for dev@plc4x.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@plc4x.apache.org
Re: [D] What is the fireDiscoveryEvent() method in GeneratedDriverBase used for?
Posted by "hutcheb (via GitHub)" <gi...@apache.org>.
GitHub user hutcheb added a comment to the discussion: What is the fireDiscoveryEvent() method in GeneratedDriverBase used for?
I think it was initially a way to get the driver to go through the discover process and wait for it to be finished before opening a connection. It was used in the opcua driver, I think, to get a list of endpoints which are then compared with the endpoint given by the plc4x address string.
It was initially called awaitSessionDiscoverComplete, but then got split into two different parameters awaitSessionDiscoverComplete and fireDiscoverEvent.
Looking at the code awaitSessionDiscoverComplete seems to require fireDiscoverEvent to be set for this functionality to work.
GitHub link: https://github.com/apache/plc4x/discussions/1123#discussioncomment-7151918
----
This is an automatically sent email for dev@plc4x.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@plc4x.apache.org