Accept it and learn from it. Actually, thank them. Scratches from sandpapers are what makes a damn good curve of a strat and LP. I give critiques to others too and I accept them as a performer as well. If they are hurt by it, then fine. It's none of your concern. If it's a below the belt blow, well you should be ready to accept it too and give him a high five. In the face. With a chair on fire.
A critique/feedback done on a personal level is always nice and welcome. It's up to you to filter it and give it thought especially if coming from someone who probably knows better, like those who have been playing all their life.
But, a heckler is another thing and is just rude. they should be taught a lesson. There you are busting your balls making an effort to sound great, then someone from the crowd shouts and screams bad stuff, it's not right. The bouncer/waiter should take him out.
These things are normal or part of the game, and I've had my share of it, when I make mistakes due to having a little more beer than what I should have had.
Important thing is finish your set as clean as possible. React by any means possible, shout back or give a gesture, but continue with your playing.
If the heckler is really bad and consistent. Deal with the a$$hole afterwards.
In my case, when there are some annoying peeps, I just tend to forget about confronting them as I'm usually too busy having a good time after the set.