Updated TcpServer to allow limiting the number of connections