Method: Appium::Core::WebSocket#handle_close

Defined in:
lib/appium_lib_core/common/ws/websocket.rb

#handle_close(code, reason) ⇒ Object

Fires when either the client or the server closes the connection. The method gets code and reason attributes. They expose the status code and message sent by the peer that closed the connection.

Default is just put a error message. The methods also clear client instance and stop the eventmachine which is called in initialising this class.



158
159
160
161
162
# File 'lib/appium_lib_core/common/ws/websocket.rb', line 158

def handle_close(code, reason)
  ::Appium::Logger.debug %W(#{self.class} :close #{code} #{reason})
  @client = nil
  EM.stop
end