func (l *HTTPStats) Close(closeClients mqtt.CloseFunc) {
	if atomic.LoadInt64(&l.end) == 0 {
		atomic.StoreInt64(&l.end, 1)

		ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
		defer cancel()
		l.httpServer.Shutdown(ctx)
		l.listen.Close()
	}

	closeClients(l.id)
}
// Close closes the listener and any client connections.
Close closes the listener and any client connections.
// Close closes the listener and any client connections .
func (l *HTTPStats) Close(closeClients mqtt.CloseFunc) {
	if atomic.LoadInt64(&l.end) == 0 {
		atomic.StoreInt64(&l.end, 1)
		ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
		defer cancel()
		l.httpServer.Shutdown(ctx)
		l.listen.Close()
	}
	closeClients(l.id)
}
func ( l * HTTPStats ) Close ( closeClients mqtt . CloseFunc ) { if atomic . LoadInt64 ( & l . end ) == 0 { atomic . StoreInt64 ( & l . end , 1 ) ctx , cancel := context . WithTimeout ( context . Background ( ) , 5 * time . Second ) defer cancel ( ) l . httpServer . Shutdown ( ctx ) l . listen . Close ( ) } closeClients ( l . id ) }
Close closes the listener and any client connections.
Close closes the listener and any client connections .