net

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConnectionError

func GetConnectionError(err error) *syscall.Errno

func ListenAndServe

func ListenAndServe(l ListenAndServeInfo) error

func ShutDown

func ShutDown(reason string)

Types

type IPV

type IPV string
const (
	IPV4 IPV = "tcp4"
	IPV6 IPV = "tcp6"
)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL