Close closes the WebSocket with the given code and reason.
(code int, reason string)
| 134 | |
| 135 | // Close closes the WebSocket with the given code and reason. |
| 136 | func (c WebSocket) Close(code int, reason string) (err error) { |
| 137 | defer handleJSError(&err, nil) |
| 138 | c.v.Call("close", code, reason) |
| 139 | return err |
| 140 | } |
| 141 | |
| 142 | // SendText sends the given string as a text message |
| 143 | // on the WebSocket. |