lib/pigato/client.rb in pigato-0.2.10 vs lib/pigato/client.rb in pigato-0.2.11

- old
+ new

@@ -63,16 +63,19 @@ def stop if @socket @socket.close end + if @ctx + @ctx.destroy + end end def reconnect_to_broker stop - @context = ZMQ::Context.new - @socket = @context.socket ZMQ::DEALER - @context.linger = 0 + @ctx = ZMQ::Context.new + @socket = @ctx.socket ZMQ::DEALER + @ctx.linger = 0 @socket.identity = SecureRandom.uuid @socket.connect @broker end end