Close the web socket after sending a close frame.

Previously, the underlying socket was being closed with the cancel call.
Because the socket was closed, the close frame could never be sent.
This commit is contained in:
Dave Roberge
2016-07-17 12:41:52 -04:00
parent edc8626496
commit 912dfa211b

View File

@@ -190,9 +190,6 @@ public class WebSocket extends Transport {
}
protected void doClose() {
if (wsCall != null) {
wsCall.cancel();
}
if (ws != null) {
try {
ws.close(1000, "");
@@ -202,6 +199,9 @@ public class WebSocket extends Transport {
// websocket already closed
}
}
if (wsCall != null) {
wsCall.cancel();
}
}
protected String uri() {