summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2011-02-04 05:03:02 (EST)
committerCaspar De Groot2011-02-04 05:03:02 (EST)
commitb3e4f5e9265d542b99875639ba5508c9626fa2ad (patch)
tree0a70ed5be318a458374cf7349e1109389ab89f37
parentd53aa29021a709af9a820222b2106395b170e101 (diff)
downloadcdo-b3e4f5e9265d542b99875639ba5508c9626fa2ad.zip
cdo-b3e4f5e9265d542b99875639ba5508c9626fa2ad.tar.gz
cdo-b3e4f5e9265d542b99875639ba5508c9626fa2ad.tar.bz2
[336320] [Net4J] Server can't open channel
https://bugs.eclipse.org/bugs/show_bug.cgi?id=336320
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ControlChannel.java9
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBuffer.java5
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/ChannelMultiplexer.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InternalChannelMultiplexer.java7
4 files changed, 12 insertions, 11 deletions
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ControlChannel.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ControlChannel.java
index 0b497b8..1be7aa5 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ControlChannel.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ControlChannel.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
@@ -28,6 +28,7 @@ import org.eclipse.internal.net4j.buffer.BufferUtil;
import org.eclipse.spi.net4j.Channel;
import org.eclipse.spi.net4j.InternalChannel;
+import org.eclipse.spi.net4j.InternalChannelMultiplexer;
import java.nio.ByteBuffer;
import java.text.MessageFormat;
@@ -37,7 +38,7 @@ import java.text.MessageFormat;
*/
public class ControlChannel extends Channel
{
- public static final short CONTROL_CHANNEL_INDEX = IBuffer.CONTROL_CHANNEL;
+ public static final short CONTROL_CHANNEL_INDEX = InternalChannelMultiplexer.RESERVED_CHANNEL;
public static final byte OPCODE_NEGOTIATION = 1;
@@ -242,9 +243,9 @@ public class ControlChannel extends Channel
private void assertValidChannelID(short channelID)
{
- if (channelID <= CONTROL_CHANNEL_INDEX)
+ if (channelID == CONTROL_CHANNEL_INDEX)
{
- throw new IllegalArgumentException("channelID <= CONTROL_CHANNEL_ID"); //$NON-NLS-1$
+ throw new IllegalArgumentException("Bad channelID"); //$NON-NLS-1$
}
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBuffer.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBuffer.java
index 9f85270..558f146 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBuffer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/IBuffer.java
@@ -96,11 +96,6 @@ public interface IBuffer
/**
* @since 2.0
*/
- public static final short CONTROL_CHANNEL = 0;
-
- /**
- * @since 2.0
- */
public static final short MIN_CHANNEL = 1;
/**
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/ChannelMultiplexer.java b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/ChannelMultiplexer.java
index 038bfc1..538217b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/ChannelMultiplexer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/ChannelMultiplexer.java
@@ -334,7 +334,7 @@ public abstract class ChannelMultiplexer extends Container<IChannel> implements
private void addChannel(InternalChannel channel)
{
short channelID = channel.getID();
- if (channelID == IBuffer.CONTROL_CHANNEL || channelID == IBuffer.NO_CHANNEL)
+ if (channelID == RESERVED_CHANNEL || channelID == IBuffer.NO_CHANNEL)
{
throw new ChannelException("Invalid channel ID: " + channelID); //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InternalChannelMultiplexer.java b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InternalChannelMultiplexer.java
index 35afa4a..a3e1a33 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InternalChannelMultiplexer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/InternalChannelMultiplexer.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
@@ -22,6 +22,11 @@ import org.eclipse.net4j.channel.IChannelMultiplexer;
public interface InternalChannelMultiplexer extends IChannelMultiplexer, IBufferProvider, ITransportConfigAware
{
/**
+ * @since 4.0
+ */
+ public static final short RESERVED_CHANNEL = 0;
+
+ /**
* Called by an {@link IChannel} each time a new buffer is available for multiplexing. This or another buffer can be
* dequeued from the outputQueue of the {@link IChannel}.
*/