StopWS terminates an already running websocket RPC API endpoint.
()
| 206 | |
| 207 | // StopWS terminates an already running websocket RPC API endpoint. |
| 208 | func (api *PrivateAdminAPI) StopWS() (bool, error) { |
| 209 | api.node.lock.Lock() |
| 210 | defer api.node.lock.Unlock() |
| 211 | |
| 212 | if api.node.wsHandler == nil { |
| 213 | return false, fmt.Errorf("WebSocket RPC not running") |
| 214 | } |
| 215 | api.node.stopWS() |
| 216 | return true, nil |
| 217 | } |
| 218 | |
| 219 | // PublicAdminAPI is the collection of administrative API methods exposed over |
| 220 | // both secure and unsecure RPC channels. |