Method: Browser::Socket#state
- Defined in:
- opal/browser/socket.rb
#state ⇒ :connecting, ... (readonly)
Returns the state of the socket.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'opal/browser/socket.rb', line 75 def state %x{ switch (#@native.readyState) { case window.WebSocket.CONNECTING: return "connecting"; case window.WebSocket.OPEN: return "open"; case window.WebSocket.CLOSING: return "closing"; case window.WebSocket.CLOSED: return "closed"; } } end |