Merge pull request #66 from wzurita/refactoring_cleanup_polling

Disconnecting after closing the stream/ reader.
This commit is contained in:
Naoyuki Kanezawa
2016-09-04 01:50:04 +09:00
committed by GitHub

View File

@@ -229,7 +229,6 @@ public class PollingXHR extends Polling {
private void onSuccess() { private void onSuccess() {
this.emit(EVENT_SUCCESS); this.emit(EVENT_SUCCESS);
this.cleanup();
} }
private void onData(String data) { private void onData(String data) {
@@ -244,7 +243,6 @@ public class PollingXHR extends Polling {
private void onError(Exception err) { private void onError(Exception err) {
this.emit(EVENT_ERROR, err); this.emit(EVENT_ERROR, err);
this.cleanup();
} }
private void onRequestHeaders(Map<String, List<String>> headers) { private void onRequestHeaders(Map<String, List<String>> headers) {
@@ -304,11 +302,9 @@ public class PollingXHR extends Polling {
try { try {
if (reader != null) reader.close(); if (reader != null) reader.close();
} catch (IOException e) {} } catch (IOException e) {}
}
}
public void abort() {
this.cleanup(); this.cleanup();
} }
}
public static class Options { public static class Options {