@Override public void run() { getAndSendInitialInfo(); System.out.println("CLIENT " + userid + ": registered on team " + team); while (true) { int plen = ClientState.getMaxSize(); byte[] buf = cs.toBytes(); DatagramPacket cp = new DatagramPacket(buf, plen); try { ds.send(cp); Thread.sleep(50); } catch (IOException | InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // send client state // receive client data }