diff options
-rw-r--r-- | src/gun_ws.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gun_ws.erl b/src/gun_ws.erl index cccb4e4..dd4830d 100644 --- a/src/gun_ws.erl +++ b/src/gun_ws.erl @@ -140,7 +140,12 @@ close(Reason, State) -> {error, badframe} -> send({close, 1002, <<>>}, State); {error, badencoding} -> - send({close, 1007, <<>>}, State) + send({close, 1007, <<>>}, State); + %% Socket errors; do nothing. + closed -> + ok; + {error, _} -> + ok end. send(Frame, State=#ws_state{socket=Socket, transport=Transport, extensions=Extensions}) -> |