func (app *App) stopListeners() {
	logger := zapwriter.Logger("app")

	if app.Api != nil {
		app.Api.Stop()
		app.Api = nil
		logger.Debug("api stopped")
	}

	if app.CarbonLink != nil {
		app.CarbonLink.Stop()
		app.CarbonLink = nil
		logger.Debug("carbonlink stopped")
	}

	if app.Carbonserver != nil {
		carbonserver := app.Carbonserver
		go func() {
			carbonserver.Stop()
			logger.Debug("carbonserver stopped")
		}()
		app.Carbonserver = nil
	}

	if app.Receivers != nil {
		for i := 0; i < len(app.Receivers); i++ {
			app.Receivers[i].Stop()
			logger.Debug("receiver stopped", zap.String("name", app.Receivers[i].Name))
		}
		app.Receivers = nil
	}
}
func (app *App) stopListeners() {
	logger := zapwriter.Logger("app")

	if app.Api != nil {
		app.Api.Stop()
		app.Api = nil
		logger.Debug("api stopped")
	}

	if app.CarbonLink != nil {
		app.CarbonLink.Stop()
		app.CarbonLink = nil
		logger.Debug("carbonlink stopped")
	}

	if app.Carbonserver != nil {
		carbonserver := app.Carbonserver
		go func() {
			carbonserver.Stop()
			logger.Debug("carbonserver stopped")
		}()
		app.Carbonserver = nil
	}

	if app.Receivers != nil {
		for i := 0; i < len(app.Receivers); i++ {
			app.Receivers[i].Stop()
			logger.Debug("receiver stopped", zap.String("name", app.Receivers[i].Name))
		}
		app.Receivers = nil
	}
}
func ( app * App ) stopListeners ( ) { logger := zapwriter . Logger ( " " ) if app . Api != nil { app . Api . Stop ( ) app . Api = nil logger . Debug ( " " ) } if app . CarbonLink != nil { app . CarbonLink . Stop ( ) app . CarbonLink = nil logger . Debug ( " " ) } if app . Carbonserver != nil { carbonserver := app . Carbonserver go func ( ) { carbonserver . Stop ( ) logger . Debug ( " " ) } ( ) app . Carbonserver = nil } if app . Receivers != nil { for i := 0 ; i < len ( app . Receivers ) ; i ++ { app . Receivers [ i ] . Stop ( ) logger . Debug ( " " , zap . String ( " " , app . Receivers [ i ] . Name ) ) } app . Receivers = nil } }
// Stop all socket listeners
Stop all socket listeners