Method: ActionCable::Connection::Base#close

Defined in:
actioncable/lib/action_cable/connection/base.rb

#close(reason: nil, reconnect: true) ⇒ Object

Close the WebSocket connection.



109
110
111
112
113
114
115
116
# File 'actioncable/lib/action_cable/connection/base.rb', line 109

def close(reason: nil, reconnect: true)
  transmit(
    type: ActionCable::INTERNAL[:message_types][:disconnect],
    reason: reason,
    reconnect: reconnect
  )
  websocket.close
end