Lines Matching defs:Server
196 // Server. It is the caller's responsibility to set
243 // type *Server.
257 server *Server
631 func (srv *Server) newConn(rwc net.Conn) *conn {
915 // This can be overridden by setting [Server.MaxHeaderBytes].
918 func (srv *Server) maxHeaderBytes() int {
925 func (srv *Server) initialReadLimitSize() int64 {
934 func (srv *Server) tlsHandshakeTimeout() time.Duration {
1531 // recommended in the Server-Sent Events candidate recommendation 11,
2857 srv := &Server{Handler: handler}
2874 srv := &Server{Handler: handler}
2878 // A Server defines parameters for running an HTTP server.
2879 // The zero value for Server is a valid configuration.
2880 type Server struct {
2898 // SetSessionTicketKeys, use Server.Serve with a TLS Listener
2949 TLSNextProto map[string]func(*Server, *tls.Conn, Handler)
2992 // graceful shutdown, use [Server.Shutdown].
2997 // Close returns any error returned from closing the [Server]'s
2999 func (srv *Server) Close() error {
3021 // quiescence during Server.Shutdown. Polling starts with a small
3035 // error returned from closing the [Server]'s underlying Listener(s).
3044 // for them to close, if desired. See [Server.RegisterOnShutdown] for a way to
3049 func (srv *Server) Shutdown(ctx context.Context) error {
3087 // RegisterOnShutdown registers a function to call on [Server.Shutdown].
3092 func (srv *Server) RegisterOnShutdown(f func()) {
3100 func (s *Server) closeIdleConns() bool {
3124 func (s *Server) closeListenersLocked() error {
3135 // It's used by the optional [Server.ConnState] hook.
3146 // bytes of a request. The Server.ConnState hook for
3189 srv *Server
3245 // ListenAndServe always returns a non-nil error. After [Server.Shutdown] or [Server.Close],
3247 func (srv *Server) ListenAndServe() error {
3262 var testHookServerServe func(*Server, net.Listener) // used if non-nil
3264 // shouldConfigureHTTP2ForServe reports whether Server.Serve should configure
3266 func (srv *Server) shouldConfigureHTTP2ForServe() bool {
3270 // didn't set it on the http.Server, but did pass it to
3276 // The user specified a TLSConfig on their http.Server.
3286 // ErrServerClosed is returned by the [Server.Serve], [ServeTLS], [ListenAndServe],
3287 // and [ListenAndServeTLS] methods after a call to [Server.Shutdown] or [Server.Close].
3288 var ErrServerClosed = errors.New("http: Server closed")
3299 // After [Server.Shutdown] or [Server.Close], the returned error is [ErrServerClosed].
3300 func (srv *Server) Serve(l net.Listener) error {
3369 // server must be provided if neither the [Server]'s
3376 // ServeTLS always returns a non-nil error. After [Server.Shutdown] or [Server.Close], the
3378 func (srv *Server) ServeTLS(l net.Listener, certFile, keyFile string) error {
3414 func (s *Server) trackListener(ln *net.Listener, add bool) bool {
3433 func (s *Server) trackConn(c *conn, add bool) {
3446 func (s *Server) idleTimeout() time.Duration {
3453 func (s *Server) readHeaderTimeout() time.Duration {
3460 func (s *Server) doKeepAlives() bool {
3464 func (s *Server) shuttingDown() bool {
3472 func (srv *Server) SetKeepAlivesEnabled(v bool) {
3485 func (s *Server) logf(format string, args ...any) {
3493 // logf prints to the ErrorLog of the *Server associated with request r
3497 s, _ := r.Context().Value(ServerContextKey).(*Server)
3513 server := &Server{Addr: addr, Handler: handler}
3523 server := &Server{Addr: addr, Handler: handler}
3532 // server must be provided if neither the [Server]'s TLSConfig.Certificates
3540 // ListenAndServeTLS always returns a non-nil error. After [Server.Shutdown] or
3541 // [Server.Close], the returned error is [ErrServerClosed].
3542 func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error {
3564 func (srv *Server) setupHTTP2_ServeTLS() error {
3569 // setupHTTP2_Serve is called from (*Server).Serve and conditionally
3577 func (srv *Server) setupHTTP2_Serve() error {
3582 func (srv *Server) onceSetNextProtoDefaults_Serve() {
3593 func (srv *Server) onceSetNextProtoDefaults() {