correctly handle connection problems for router tcp server