diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/plum/client.rb | 2 | ||||
-rw-r--r-- | lib/plum/connection.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/plum/client.rb b/lib/plum/client.rb index 3749482..81066d7 100644 --- a/lib/plum/client.rb +++ b/lib/plum/client.rb @@ -62,7 +62,7 @@ module Plum # Closes the connection. def close - @plum.close if @plum && @plum.state != :closed + @plum.close if @plum ensure @socket.close if @socket end diff --git a/lib/plum/connection.rb b/lib/plum/connection.rb index f365861..1d47360 100644 --- a/lib/plum/connection.rb +++ b/lib/plum/connection.rb @@ -38,6 +38,7 @@ module Plum # Emits :close event. Doesn't actually close socket. def close + return if @state == :closed @state = :closed # TODO: server MAY wait streams callback(:close) |