Method: Browser::Socket#close

Defined in:
opal/browser/socket.rb

#close(code = nil, reason = nil) ⇒ Object

Close the socket.

Parameters:

  • code (Integer, nil) (defaults to: nil)

    the error code

  • reason (String, nil) (defaults to: nil)

    the reason for closing



119
120
121
# File 'opal/browser/socket.rb', line 119

def close(code = nil, reason = nil)
  `#@native.close(#{code.to_n}, #{reason.to_n})`
end