From 03fb42f7b5cd808eca68ea870c0be57c4527ca9f Mon Sep 17 00:00:00 2001 From: Tobias Schwarz Date: Tue, 14 May 2013 11:00:11 +0200 Subject: Target Explorer: fix events getting lost --- .../src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java index 85a4ecea5..be0e83d97 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java @@ -945,9 +945,6 @@ public final class ChannelManager extends PlatformObject implements IChannelMana if (!forceNew) channels.put(id, channel); if (!forceNew) refCounters.put(id, new AtomicInteger(1)); - // Redirect the channel to the next value-add in chain - // Note: If the redirect succeeds, channel.getRemotePeer().getID() will be identical to id. - channel.redirect(nextValueAddPeer.get() != null ? nextValueAddPeer.get().getAttributes() : attrs); // Attach the channel listener to catch open/closed events final IChannel finChannel = channel; channel.addChannelListener(new IChannel.IChannelListener() { @@ -1023,6 +1020,10 @@ public final class ChannelManager extends PlatformObject implements IChannelMana public void congestionLevel(int level) { } }); + + // Redirect the channel to the next value-add in chain + // Note: If the redirect succeeds, channel.getRemotePeer().getID() will be identical to id. + channel.redirect(nextValueAddPeer.get() != null ? nextValueAddPeer.get().getAttributes() : attrs); } else { // Channel is null? Something went terrible wrong. done.doneChainValueAdd(new Exception("Unexpected null return value from IPeer#openChannel()!"), null); //$NON-NLS-1$ -- cgit v1.2.3