// Stop stops the servers and closes all listeners.
Stop stops the servers and closes all listeners.
// Stop stops the servers and closes all listeners .
func (a App) Stop() error {
	for _, pc := range a.packetConns {
		err := pc.Close()
		if err != nil {
			a.logger.Error("closing packet listener",
				zap.String("network", pc.LocalAddr().Network()),
				zap.String("address", pc.LocalAddr().String()),
				zap.Error(err))
		}
	}
	for _, ln := range a.listeners {
		err := ln.Close()
		if err != nil {
			a.logger.Error("closing listener",
				zap.String("network", ln.Addr().Network()),
				zap.String("address", ln.Addr().String()),
				zap.Error(err))
		}
	}
	return nil
}
func ( a App ) Stop ( ) error { for _ , pc := range a . packetConns { err := pc . Close ( ) if err != nil { a . logger . Error ( " " , zap . String ( " " , pc . LocalAddr ( ) . Network ( ) ) , zap . String ( " " , pc . LocalAddr ( ) . String ( ) ) , zap . Error ( err ) ) } } for _ , ln := range a . listeners { err := ln . Close ( ) if err != nil { a . logger . Error ( " " , zap . String ( " " , ln . Addr ( ) . Network ( ) ) , zap . String ( " " , ln . Addr ( ) . String ( ) ) , zap . Error ( err ) ) } } return nil }
Stop stops the servers and closes all listeners.
Stop stops the servers and closes all listeners .