diff --git a/lib/landline/extensions/websocket.rb b/lib/landline/extensions/websocket.rb index 1082328..0d15576 100644 --- a/lib/landline/extensions/websocket.rb +++ b/lib/landline/extensions/websocket.rb @@ -93,7 +93,7 @@ module Landline rescue Errno::EPIPE => e @writable = false _emit :error, e - close + close if @readable nil end @@ -210,7 +210,7 @@ module Landline end rescue Errno::ECONNRESET => e _emit :error, e - close + close if @readable or @writable nil end @@ -224,7 +224,7 @@ module Landline end rescue Errno::ECONNRESET => e _emit :error, e - close + close if @readable or @writable nil end end