LivingLikeKrillin commented on code in PR #2640: URL: https://github.com/apache/plc4x/pull/2640#discussion_r3575687151
########## plc4j/drivers/slmp/src/main/java/org/apache/plc4x/java/slmp/config/SlmpConfiguration.java: ########## @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.slmp.config; + +import org.apache.plc4x.java.spi.config.Configuration; +import org.apache.plc4x.java.spi.config.annotations.ConfigurationParameter; +import org.apache.plc4x.java.spi.config.annotations.Description; +import org.apache.plc4x.java.spi.config.annotations.defaults.IntDefaultValue; + +public class SlmpConfiguration implements Configuration { + + @ConfigurationParameter("monitoring-timer") + @IntDefaultValue(0x0000) + @Description("SLMP monitoring timer written into each 3E request frame (0 = wait infinitely).") + private int monitoringTimer; + + @ConfigurationParameter("request-timeout") + @IntDefaultValue(5_000) + @Description("Client-side timeout in milliseconds awaiting a response.") + private int requestTimeout; + + public int getMonitoringTimer() { + return monitoringTimer; + } + + public void setMonitoringTimer(int monitoringTimer) { + this.monitoringTimer = monitoringTimer; + } + + public int getRequestTimeout() { + return requestTimeout; + } + + public void setRequestTimeout(int requestTimeout) { + this.requestTimeout = requestTimeout; + } Review Comment: Fixed in 237d195d. `request-timeout` is now rejected when `<= 0` — a non-positive value handed to `CompletableFuture.orTimeout(...)` would time out every request immediately — and fails with `PlcConnectionException`. Same placement rationale as `monitoring-timer`: validated in `onConnect()` because field injection bypasses the setter. Covered by `connectRejectsNonPositiveRequestTimeout`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
