Serve registers a listener and runs blockingly to provide services, including listening to ports, accepting connections and processing trans data. When an exception occurs or Shutdown is invoked, Serve will return an error which describes the specific reason.
(ln net.Listener)
| 25 | // accepting connections and processing trans data. When an exception occurs or Shutdown is invoked, |
| 26 | // Serve will return an error which describes the specific reason. |
| 27 | Serve(ln net.Listener) error |
| 28 | |
| 29 | // Shutdown is used to graceful exit. |
| 30 | // It will close all idle connections on the server, but will not change the underlying pollers. |
no outgoing calls