lib/juggernaut/server.rb in dima-exe-juggernaut-0.5.9.25 vs lib/juggernaut/server.rb in dima-exe-juggernaut-0.5.9.26
- old
+ new
@@ -52,10 +52,11 @@
attr_reader :logout_timeout
attr_reader :status
attr_reader :channels
attr_reader :client
+
# EM methods
def post_init
logger.debug "New client [#{client_ip}]"
@client = nil
@@ -184,11 +185,11 @@
end
# Connection methods
- def broadcast(bdy)
- msg = Juggernaut::Message.new(@current_msg_id += 1, bdy, self.signature)
+ def broadcast(bdy, timestamp = nil)
+ msg = Juggernaut::Message.new(@current_msg_id += 1, bdy, self.signature, timestamp)
publish(msg)
end
def mark_dead(reason = "Unknown error")
# Once dead, a client never recovers since a reconnection