Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConnectionError ¶
func ListenAndServe ¶
func ListenAndServe(l ListenAndServeInfo) error
Types ¶
type ListenAndServeInfo ¶
type ListenAndServeInfo struct {
Ipversion IPV //the ip version, tcp4 or tcp6
// Addr optionally specifies the TCP address for the server to listen on,
// in the form "host:port". If empty, ":http" (port 80) is used.
// The service names are defined in RFC 6335 and assigned by IANA.
// See net.Dial for details of the address format.
Address string
Handler http.Handler // handler to invoke, http.DefaultServeMux if nil
// WriteTimeout is the maximum duration before timing out
// writes of the response, in seconds. It is reset whenever a new
// request's header is read. Like ReadTimeout, it does not
// let Handlers make decisions on a per-request basis.
WriteTimeout time.Duration
// ReadTimeout is the maximum duration for reading the entire
// request, including the body, in seconds.
//
// Because ReadTimeout does not let Handlers make per-request
// decisions on each request body's acceptable deadline or
// upload rate, most users will prefer to use
// ReadHeaderTimeout. It is valid to use them both.
ReadTimeout time.Duration
// IdleTimeout is the maximum amount of time to wait for the
// next request when keep-alives are enabled. If IdleTimeout
// is zero, the value of ReadTimeout is used. If both are
// zero, there is no timeout.
IdleTimeout time.Duration
}
A ListenAndServeInfo defines parameters for running the HTTP server. The zero value for Server is a valid configuration.
Click to show internal directories.
Click to hide internal directories.