func NewWithOptions(o Options) *Server {
	var listener *Listener
	if o.Listener != nil {
		g, ok := o.Listener.(*Listener)
		if !ok {
			listener = NewListener(o.Listener)
		} else {
			listener = g
		}
	}
	if o.Server == nil {
		o.Server = new(http.Server)
	}
	return &Server{
		Server:           o.Server,
		listener:         listener,
		stateHandler:     o.StateHandler,
		shutdown:         make(chan bool),
		shutdownFinished: make(chan bool, 1),
		wg:               new(sync.WaitGroup),
		connToProps:      make(map[net.Conn]connProperties),
	}
}
NewWithOptions creates a GracefulServer instance with the specified options.
package graceful
import (
	"crypto/tls"
	"net"
	"net/http"
	"os"
	"sync"
	"sync/atomic"
	"unsafe"
)
type StateHandler func(net.Conn, http.ConnState, http.ConnState)
type Options struct {
	Server       *http.Server
	StateHandler StateHandler
	Listener     net.Listener
}
type Server struct {
	*http.Server
	shutdown         chan bool
	shutdownFinished chan bool
	wg               *sync.WaitGroup
	routinesCount    int32
	listener         *Listener
	stateHandler     StateHandler
	connToProps      map[net.Conn]connProperties
	connToPropsMtx   sync.RWMutex
	up chan net.Listener  
}
func NewServer() *Server {
	return NewWithOptions(Options{})
}
func NewWithServer(s *http.Server) *Server {
	return NewWithOptions(Options{Server: s})
}