You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/09/28 10:32:07 UTC
[incubator-plc4x] 05/05: [General]
SingleItemToSingleRequestProtocol added note about wrongly instantiated
timer
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
commit 00dd8704bde102bc5e6545eb0c714aba0edddcc7
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Sep 28 12:31:53 2018 +0200
[General] SingleItemToSingleRequestProtocol added note about wrongly
instantiated timer
---
.../plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java
index 36fadfe..4d961c6 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java
+++ b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java
@@ -104,6 +104,12 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler {
@Override
public void channelRegistered(ChannelHandlerContext ctx) throws Exception {
this.queue = new PendingWriteQueue(ctx);
+ /*
+ * TODO: this needs to be supplied globally
+ * from {@link HashedWheelTimer}:
+ * One of the common mistakes, that makes
+ * your application unresponsive, is to create a new instance for every connection
+ */
this.timer = new HashedWheelTimer();
this.scheduledTimeouts = new ConcurrentHashMap<>();
this.sentButUnacknowledgedSubContainer = new ConcurrentHashMap<>();