Improvements to tcp listener. Add internal metrics.