Added connection counting for the tcp server.