Server implements a generic TCP server.
| 24 | |
| 25 | // Server implements a generic TCP server. |
| 26 | type Server struct { |
| 27 | Handler Handler |
| 28 | conns map[net.Conn]bool |
| 29 | Addr string |
| 30 | // ListenAddr is the actual address the server is listening on. |
| 31 | // This is used for route lookup when PROXY protocol is enabled, |
| 32 | // since in.LocalAddr() returns the destination from the PROXY header. |
| 33 | ListenAddr string |
| 34 | |
| 35 | listeners []net.Listener |
| 36 | ReadTimeout time.Duration |
| 37 | WriteTimeout time.Duration |
| 38 | |
| 39 | mu sync.Mutex |
| 40 | } |
| 41 | |
| 42 | func (s *Server) ListenAndServe() error { |
| 43 | l, err := net.Listen("tcp", s.Addr) |
nothing calls this directly
no outgoing calls
no test coverage detected