stopWS terminates the websocket RPC endpoint.
()
| 379 | |
| 380 | // stopWS terminates the websocket RPC endpoint. |
| 381 | func (n *Node) stopWS() { |
| 382 | if n.wsListener != nil { |
| 383 | _ = n.wsListener.Close() |
| 384 | n.wsListener = nil |
| 385 | n.log.Info("WebSocket endpoint closed", "url", fmt.Sprintf("ws://%s", n.wsEndpoint)) |
| 386 | } |
| 387 | if n.wsHandler != nil { |
| 388 | n.wsHandler.Stop() |
| 389 | n.wsHandler = nil |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | // Stop terminates a running node along with all it's services. In the node was |
| 394 | // not started, an error is returned. |