Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/transport configuration rework #1179

Merged
merged 10 commits into from
Oct 30, 2023

Conversation

chrisdutz
Copy link
Contributor

Reworked the configuration of transports so a transports configuration options are referenced by a prefix, that matches the transport code.

So for example in S7 I can customize the timeout like this:

s7://192.168.23.30?tcp.default-timeout=3000

@chrisdutz chrisdutz requested a review from sruehl October 30, 2023 10:19
plc4j/drivers/ads/pom.xml Show resolved Hide resolved
plc4j/drivers/firmata/pom.xml Show resolved Hide resolved
@@ -111,7 +112,7 @@ public Plc4xProtocolBase<BASE_PACKET_CLASS> configurePipeline(Configuration conf
if (driverContextClass != null) {
protocol.setDriverContext(configure(configuration, createInstance(driverContextClass)));
}
Plc4xNettyWrapper<BASE_PACKET_CLASS> context = new Plc4xNettyWrapper<>(configuration.getTimeoutManager(), pipeline, passive, protocol,
Plc4xNettyWrapper<BASE_PACKET_CLASS> context = new Plc4xNettyWrapper<>(new NettyHashTimerTimeoutManager(), pipeline, passive, protocol,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above: why is this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was simply me cleaning up something that I thought didn't belong into the configuration.

@@ -28,4 +28,8 @@ public interface Transport {

ChannelFactory createChannelFactory(String transportConfig);

default Class<? extends TransportConfiguration> getTransportConfigType() {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also consider the use of optional, depending on how it is use (not a issue with null)


public interface TransportConfigurationTypeProvider {

Class<? extends TransportConfiguration> getTransportConfigurationType(String transportCode);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see optional comment above

@sruehl
Copy link
Contributor

sruehl commented Oct 30, 2023

LGTM

@chrisdutz chrisdutz merged commit 554c083 into develop Oct 30, 2023
17 checks passed
@chrisdutz chrisdutz deleted the feature/transport-configuration-rework branch October 30, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants