Put the counter int the connectBradcast method in IOManager class outside the for-loop