From ae96ac4893211092589887ca611a4667b438f897 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Mon, 30 May 2011 14:11:24 +0000 Subject: [PATCH] -use constant rather than hardcoded string for tcpnodelay option --- .../internal/core/model/IDataStoreSystemProperties.java | 8 ++++++++ .../src/org/eclipse/dstore/internal/core/util/Sender.java | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/model/IDataStoreSystemProperties.java b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/model/IDataStoreSystemProperties.java index c990490b3c9..a6cf2444714 100644 --- a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/model/IDataStoreSystemProperties.java +++ b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/model/IDataStoreSystemProperties.java @@ -99,4 +99,12 @@ public interface IDataStoreSystemProperties { // path to the server jars public static final String A_PLUGIN_PATH="A_PLUGIN_PATH"; //$NON-NLS-1$ + + + /***************************************************************** + * TCPNODELAY option + *****************************************************************/ + // specifying this as true disables Nagle's algorithm + public static final String DSTORE_TCP_NO_DELAY="DSTORE_TCP_NO_DELAY"; //$NON-NLS-1$ + } diff --git a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/util/Sender.java b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/util/Sender.java index 6be402c1f1b..1dca0dca43a 100644 --- a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/util/Sender.java +++ b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/util/Sender.java @@ -37,6 +37,7 @@ import org.eclipse.dstore.core.java.IRemoteClassInstance; import org.eclipse.dstore.core.model.DE; import org.eclipse.dstore.core.model.DataElement; import org.eclipse.dstore.core.model.DataStore; +import org.eclipse.dstore.internal.core.model.IDataStoreSystemProperties; /** * This class is used for sending data to a socket in the DataStore @@ -65,7 +66,7 @@ public class Sender implements ISender _xmlGenerator = new XMLgenerator(_dataStore); try { - String noDelayStr = System.getProperty("DSTORE_TCP_NO_DELAY"); //$NON-NLS-1$ + String noDelayStr = System.getProperty(IDataStoreSystemProperties.DSTORE_TCP_NO_DELAY); if (noDelayStr != null && noDelayStr.length() > 0){ try { boolean noDelay = Boolean.valueOf(noDelayStr).booleanValue();