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:
@@ -190,9 +190,6 @@ public class WebSocket extends Transport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void doClose() {
|
protected void doClose() {
|
||||||
if (wsCall != null) {
|
|
||||||
wsCall.cancel();
|
|
||||||
}
|
|
||||||
if (ws != null) {
|
if (ws != null) {
|
||||||
try {
|
try {
|
||||||
ws.close(1000, "");
|
ws.close(1000, "");
|
||||||
@@ -202,6 +199,9 @@ public class WebSocket extends Transport {
|
|||||||
// websocket already closed
|
// websocket already closed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (wsCall != null) {
|
||||||
|
wsCall.cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String uri() {
|
protected String uri() {
|
||||||
|
|||||||
Reference in New Issue
Block a user