Updated client to close and reopen the connection once every 500 pushes