lib/em-websocket/handler.rb in em-websocket-0.4.0 vs lib/em-websocket/handler.rb in em-websocket-0.5.0
- old
+ new
@@ -1,10 +1,10 @@
module EventMachine
module WebSocket
class Handler
def self.klass_factory(version)
- handler_klass = case version
+ case version
when 75
Handler75
when 76
Handler76
when 1..3
@@ -50,10 +50,16 @@
# Implemented in subclass
end
def unbind
@state = :closed
- @connection.trigger_on_close
+
+ @close_info = defined?(@close_info) ? @close_info : {
+ :code => 1006,
+ :was_clean => false,
+ }
+
+ @connection.trigger_on_close(@close_info )
end
def ping
# Overridden in subclass
false