lib/pigato/client.rb in pigato-0.2.5 vs lib/pigato/client.rb in pigato-0.2.6
- old
+ new
@@ -61,17 +61,16 @@
def start
reconnect_to_broker
end
def stop
- $socket.close
- end
-
- def reconnect_to_broker
if @socket
- @socket.close
+ $socket.close
end
+ end
+ def reconnect_to_broker
+ stop
@socket = @context.socket ZMQ::DEALER
@context.linger = 0
@socket.identity = SecureRandom.uuid
@socket.connect @broker
end