sentinel.go
func (s *Sentinel) Mux(listener net.Listener, opts ...netmux.Option) (*netmux.Netmux, error) {
	s.Lock()
	defer s.Unlock()

	if s.started {
		return nil, ErrAlreadyStarted
	}

	// create connection mux
	mux, err := netmux.New(listener, opts...)
	if err != nil {
		return nil, err
	}

	// register server + shutdown
	if err = s.Register(mux, mux, IgnoreListenerClosed, IgnoreNetOpError); err != nil {
		return nil, err
	}

	return mux, nil
}
func (s *Sentinel) Mux(listener net.Listener, opts ...netmux.Option) (*netmux.Netmux, error) {
	s.Lock()
	defer s.Unlock()

	if s.started {
		return nil, ErrAlreadyStarted
	}

	// create connection mux
	mux, err := netmux.New(listener, opts...)
	if err != nil {
		return nil, err
	}

	// register server + shutdown
	if err = s.Register(mux, mux, IgnoreListenerClosed, IgnoreNetOpError); err != nil {
		return nil, err
	}

	return mux, nil
}
// Mux creates a new network connection muxer and registers its server,
// shutdown, and ignore error funcs.