for (int i = 0; i < count; i++) {
buff.position(0);
buff.limit(buff.capacity());
int id = r.nextInt(1024);
msg.setId(id);
int bytes = channel.send(encoder.encode(msg, null), target);
if (bytes < 1) {
System.err.println("write fail :/ " + bytes);
} else {
buff.position(0);