lib/submodules/ably-ruby/lib/ably/realtime/connection/websocket_transport.rb in ably-rest-0.8.1 vs lib/submodules/ably-ruby/lib/ably/realtime/connection/websocket_transport.rb in ably-rest-0.8.2

- old
+ new

@@ -23,11 +23,11 @@ setup_event_handlers end # Disconnect the socket transport connection and write all pending text. - # If Disconnected state is not automatically triggered, it will be triggered automatically + # If Disconnected state is not automatically emitted, it will be emitted automatically # @return [void] # @api public def disconnect close_connection_after_writing change_state STATE.Disconnecting @@ -147,10 +147,10 @@ action_name = Ably::Models::ProtocolMessage::ACTION[event_data['action']] rescue event_data['action'] logger.debug "WebsocketTransport: Prot msg recv <=: #{action_name} - #{event_data}" if protocol_message.invalid? error = Ably::Exceptions::ProtocolError.new("Invalid Protocol Message received: #{event_data}\nMessage has been discarded", 400, 80013) - connection.trigger :error, error + connection.emit :error, error logger.fatal "WebsocketTransport: #{error.message}" else __incoming_protocol_msgbus__.publish :protocol_message, protocol_message end end