diff options
author | Uwe Stieber | 2011-10-18 15:35:31 +0000 |
---|---|---|
committer | Uwe Stieber | 2011-10-18 15:35:31 +0000 |
commit | 5e064e1ea77bf35079ebd8940392d400ada1aa7a (patch) | |
tree | f20c67828df38bdd27aaf49cc5df222e491ec28e | |
parent | fff238bb207b1bb78b1da0901c368fc7fb2709b9 (diff) | |
download | org.eclipse.tcf-5e064e1ea77bf35079ebd8940392d400ada1aa7a.tar.gz org.eclipse.tcf-5e064e1ea77bf35079ebd8940392d400ada1aa7a.tar.xz org.eclipse.tcf-5e064e1ea77bf35079ebd8940392d400ada1aa7a.zip |
Target Explorer: Send EOS to the remote before disconnecting from the terminal streams
-rw-r--r-- | target_explorer/plugins/org.eclipse.tm.te.tcf.terminals.core/src/org/eclipse/tm/te/tcf/terminals/core/launcher/TerminalsStreamsListener.java | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/target_explorer/plugins/org.eclipse.tm.te.tcf.terminals.core/src/org/eclipse/tm/te/tcf/terminals/core/launcher/TerminalsStreamsListener.java b/target_explorer/plugins/org.eclipse.tm.te.tcf.terminals.core/src/org/eclipse/tm/te/tcf/terminals/core/launcher/TerminalsStreamsListener.java index a77f83cf5..273a425e7 100644 --- a/target_explorer/plugins/org.eclipse.tm.te.tcf.terminals.core/src/org/eclipse/tm/te/tcf/terminals/core/launcher/TerminalsStreamsListener.java +++ b/target_explorer/plugins/org.eclipse.tm.te.tcf.terminals.core/src/org/eclipse/tm/te/tcf/terminals/core/launcher/TerminalsStreamsListener.java @@ -408,7 +408,7 @@ public class TerminalsStreamsListener implements IStreams.StreamsListener, ITerm */ protected class StreamWriterRunnable implements Runnable { // The associated stream id - private final String streamId; + /* default */ final String streamId; // The associated stream type id @SuppressWarnings("unused") private final String streamTypeId; @@ -551,16 +551,23 @@ public class TerminalsStreamsListener implements IStreams.StreamsListener, ITerm // Disconnect from the stream if (svcStreams != null) { - svcStreams.disconnect(streamId, new IStreams.DoneDisconnect() { + // Write EOS first + svcStreams.eos(streamId, new IStreams.DoneEOS() { @Override - @SuppressWarnings("synthetic-access") - public void doneDisconnect(IToken token, Exception error) { - // Disconnect is done, ignore any error, invoke the callback - synchronized (this) { - if (getCallback() != null) getCallback().done(this, Status.OK_STATUS); - } - // Mark the runnable definitely stopped - stopped = true; + public void doneEOS(IToken token, Exception error) { + // Disconnect now + svcStreams.disconnect(streamId, new IStreams.DoneDisconnect() { + @Override + @SuppressWarnings("synthetic-access") + public void doneDisconnect(IToken token, Exception error) { + // Disconnect is done, ignore any error, invoke the callback + synchronized (this) { + if (getCallback() != null) getCallback().done(this, Status.OK_STATUS); + } + // Mark the runnable definitely stopped + stopped = true; + } + }); } }); } else { |