diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2019-09-19 14:17:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-19 14:17:05 +0800 |
commit | 5641ef570693c2ec674a773459e2d01934b2d5de (patch) | |
tree | b57e6f2c337a5b0843a6a271270a2acc3d7a5add | |
parent | 768fcb9b53b71d39ac43fa1b019db28d87deef25 (diff) | |
download | cask-5641ef570693c2ec674a773459e2d01934b2d5de.tar.gz cask-5641ef570693c2ec674a773459e2d01934b2d5de.tar.bz2 cask-5641ef570693c2ec674a773459e2d01934b2d5de.zip |
Update WebsocketClientImpl.scala
-rw-r--r-- | cask/util/src-jvm/cask/util/WebsocketClientImpl.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cask/util/src-jvm/cask/util/WebsocketClientImpl.scala b/cask/util/src-jvm/cask/util/WebsocketClientImpl.scala index 0ac8c1d..2d65de6 100644 --- a/cask/util/src-jvm/cask/util/WebsocketClientImpl.scala +++ b/cask/util/src-jvm/cask/util/WebsocketClientImpl.scala @@ -26,7 +26,9 @@ abstract class WebsocketClientImpl(url: String) extends WebsocketBase{ } def onClose(code: Int, reason: String): Unit def onError(ex: Exception): Unit - def close(): Unit = websocket.close() + def close(): Unit = { + if (!closed) websocket.close() + } def isClosed() = websocket.isClosed() class Client() extends WebSocketClient(new java.net.URI(url)){ def onOpen(handshakedata: ServerHandshake) = { |