aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/connection/base.rb
diff options
context:
space:
mode:
authorDaniel Rhodes <rhodes.daniel@gmail.com>2016-03-01 01:21:19 +0100
committerDaniel Rhodes <rhodes.daniel@gmail.com>2016-03-01 01:38:35 +0100
commitf51cb7eef5be8e3496ea653fec04bedd6e5ec334 (patch)
tree4f4e8da88b138334aaf7c8b4814a295c8575abbc /actioncable/lib/action_cable/connection/base.rb
parentaf2c427c390b87ea20986f1e82b498068800d775 (diff)
downloadrails-f51cb7eef5be8e3496ea653fec04bedd6e5ec334.tar.gz
rails-f51cb7eef5be8e3496ea653fec04bedd6e5ec334.tar.bz2
rails-f51cb7eef5be8e3496ea653fec04bedd6e5ec334.zip
Added welcome message type and fix test hacks
Diffstat (limited to 'actioncable/lib/action_cable/connection/base.rb')
-rw-r--r--actioncable/lib/action_cable/connection/base.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actioncable/lib/action_cable/connection/base.rb b/actioncable/lib/action_cable/connection/base.rb
index 60f3ad3e06..7a9507fbd9 100644
--- a/actioncable/lib/action_cable/connection/base.rb
+++ b/actioncable/lib/action_cable/connection/base.rb
@@ -154,7 +154,7 @@ module ActionCable
def handle_open
connect if respond_to?(:connect)
subscribe_to_internal_channel
- confirm_connection_monitor_subscription
+ send_welcome_message
message_buffer.process!
server.add_connection(self)
@@ -173,11 +173,11 @@ module ActionCable
disconnect if respond_to?(:disconnect)
end
- def confirm_connection_monitor_subscription
- # Send confirmation message to the internal connection monitor channel.
+ def send_welcome_message
+ # Send welcome message to the internal connection monitor channel.
# This ensures the connection monitor state is reset after a successful
# websocket connection.
- transmit ActiveSupport::JSON.encode(identifier: ActionCable::INTERNAL[:identifiers][:ping], type: ActionCable::INTERNAL[:message_types][:confirmation])
+ transmit ActiveSupport::JSON.encode(type: ActionCable::INTERNAL[:message_types][:welcome])
end
def allow_request_origin?