diff options
author | Eugene Tarassov | 2018-12-26 21:34:18 +0000 |
---|---|---|
committer | Eugene Tarassov | 2018-12-26 21:34:18 +0000 |
commit | 2385d4fa0d7634de8ade13d06060aad5043ed1ee (patch) | |
tree | 0d46ca63701c22494cae12c61b89fc03f11bcea6 | |
parent | f565dce9cf94da8116e09b54e97f0b36359d6a00 (diff) | |
download | org.eclipse.tcf-2385d4fa0d7634de8ade13d06060aad5043ed1ee.tar.gz org.eclipse.tcf-2385d4fa0d7634de8ade13d06060aad5043ed1ee.tar.xz org.eclipse.tcf-2385d4fa0d7634de8ade13d06060aad5043ed1ee.zip |
TCF Core: added channel stopped notification in TCF HTTP channel
-rw-r--r-- | plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ChannelHTTP.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ChannelHTTP.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ChannelHTTP.java index 2f295a4f8..c04187502 100644 --- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ChannelHTTP.java +++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ChannelHTTP.java @@ -151,7 +151,14 @@ public class ChannelHTTP extends AbstractChannel { @Override protected void stop() throws IOException { + assert !stopped; stopped = true; + URL url = new URL("http://" + host + ":" + port + "/tcf/stop/"); + HttpURLConnection con = (HttpURLConnection)url.openConnection(); + con.setRequestProperty("Content-Type", "application/json"); + con.setRequestProperty("X-Session-ID", id); + con.setRequestMethod("GET"); + con.getInputStream().close(); } private char toHexDigit(int n) { @@ -221,6 +228,7 @@ public class ChannelHTTP extends AbstractChannel { String nm = token != null ? "/tcf/c/" + token + "/" : "/tcf/e/"; nm = "http://" + host + ":" + port + nm + service + "/" + command; if (args != null && args.length() > 0) nm += "?" + args; + assert !stopped; URL url = new URL(nm); HttpURLConnection con = (HttpURLConnection)url.openConnection(); con.setRequestProperty("Content-Type", "application/json"); |