method

close

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ClientSocket
close(code = nil, reason = nil) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actioncable/lib/action_cable/connection/client_socket.rb, line 90
      def close(code = nil, reason = nil)
        code   ||= 1000
        reason ||= ""

        unless code == 1000 || (code >= 3000 && code <= 4999)
          raise ArgumentError, "Failed to execute 'close' on WebSocket: "                                 "The code must be either 1000, or between 3000 and 4999. "                                 "#{code} is neither."
        end

        @ready_state = CLOSING unless @ready_state == CLOSED
        @driver.close(reason, code)
      end
Register or log in to add new notes.