func (srv *Server) ListenAndServe() error {
	addr := srv.Addr
	if addr == "" {
		addr = ":http"
	}
	if runtime.GOOS == "windows" {
		l, err := srv.listenTCP(addr)
		if err != nil {
			return err
		}
		return srv.Serve(l)
	}
	if IsMaster() {
		var l listener
		var err error
		if strings.HasPrefix(addr, "unix:") {
			l, err = srv.listenUnix(addr[len("unix:"):])
		} else {
			l, err = srv.listenTCP(addr)
		}
		if err != nil {
			return err
		}
		return srv.supervise(l)
	}
	ln, err := srv.listenerFromFDEnv()
	if err != nil {
		return err
	}
	return srv.Serve(ln)
}
ListenAndServe acts like http.Server.ListenAndServe but can be graceful
shutdown and restart. If srv.Addr begin with "unix:", will listen on a Unix
domain socket instead of TCP.
package miyabi
import (
	"crypto/tls"
	"errors"
	"fmt"
	"net"
	"net/http"
	"os"
	"os/exec"
	"os/signal"
	"runtime"
	"strconv"
	"strings"
	"sync"
	"syscall"
	"time"
)
var (
	ShutdownSignal = syscall.SIGTERM
	RestartSignal = syscall.SIGHUP
	Timeout = 3 * time.Minute
	ServerState func(state State)
	FDEnvKey = "MIYABI_FD"
	errNotForked = errors.New("server isn't forked")
)
func ListenAndServe(addr string, handler http.Handler) error {
	server := &Server{Addr: addr, Handler: handler}
	return server.ListenAndServe()
}
func ListenAndServeTLS(addr, certFile, keyFile string, handler http.Handler) error {
	server := &Server{Addr: addr, Handler: handler}
	return server.ListenAndServeTLS(certFile, keyFile)
}
type Server http.Server