Stop stops the server. Note that this function should only be called once and the server should not be used afterwards.
(timeout time.Duration)
| 80 | // Stop stops the server. Note that this function should only be called once |
| 81 | // and the server should not be used afterwards. |
| 82 | func (s *Server) Stop(timeout time.Duration) { |
| 83 | s.socket.Close() |
| 84 | s.Wait() |
| 85 | |
| 86 | // This will cause existing clients to be terminated safely. If the |
| 87 | // registered handlers have a Stop callback, it will be called. |
| 88 | s.server.Load().Stop(timeout) |
| 89 | } |
| 90 | |
| 91 | // StartServing starts listening for connect and spawns the main service |
| 92 | // goroutine for handling incoming control requests. StartServing does not |