diff options
author | Caspar De Groot | 2011-02-04 10:03:02 +0000 |
---|---|---|
committer | Caspar De Groot | 2011-02-04 10:03:02 +0000 |
commit | b3e4f5e9265d542b99875639ba5508c9626fa2ad (patch) | |
tree | 0a70ed5be318a458374cf7349e1109389ab89f37 | |
parent | d53aa29021a709af9a820222b2106395b170e101 (diff) | |
download | cdo-b3e4f5e9265d542b99875639ba5508c9626fa2ad.tar.gz cdo-b3e4f5e9265d542b99875639ba5508c9626fa2ad.tar.xz cdo-b3e4f5e9265d542b99875639ba5508c9626fa2ad.zip |
[336320] [Net4J] Server can't open channel
https://bugs.eclipse.org/bugs/show_bug.cgi?id=336320
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 0b497b8173..1be7aa5e39 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 9f852701a5..558f146514 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 038bfc1620..538217b159 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 35afa4adba..a3e1a33ccc 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}. */ |