/** * Add a random amount of random data to the target buffer using the thread-local RNG. * * @param target the target buffer */ public static void addRandom(ByteBuffer target) { addRandom(target, IoUtils.getThreadLocalRandom()); }
/** * Add {@code count} bytes of random data to the target buffer using the thread-local RNG. * * @param target the target buffer * @param count the number of bytes to add */ public static void addRandom(ByteBuffer target, int count) { addRandom(target, IoUtils.getThreadLocalRandom(), count); }
public void wakeupAccepts() { tcpServerLog.logf(FQCN, Logger.Level.TRACE, null, "Wake up accepts on %s", this); resumeAccepts(); final NioTcpServerHandle[] handles = this.handles; final int idx = IoUtils.getThreadLocalRandom().nextInt(handles.length); handles[idx].wakeup(SelectionKey.OP_ACCEPT); }
/** * Add {@code count} bytes of random data to the target buffer using the thread-local RNG. * * @param target the target buffer * @param count the number of bytes to add */ public static void addRandom(ByteBuffer target, int count) { addRandom(target, IoUtils.getThreadLocalRandom(), count); }
/** * Add a random amount of random data to the target buffer using the thread-local RNG. * * @param target the target buffer */ public static void addRandom(ByteBuffer target) { addRandom(target, IoUtils.getThreadLocalRandom()); }
public void wakeupAccepts() { tcpServerLog.logf(FQCN, Logger.Level.TRACE, null, "Wake up accepts on %s", this); resumeAccepts(); final NioTcpServerHandle[] handles = this.handles; final int idx = IoUtils.getThreadLocalRandom().nextInt(handles.length); handles[idx].wakeup(SelectionKey.OP_ACCEPT); }
public void wakeupAccepts() { tcpServerLog.logf(FQCN, Logger.Level.TRACE, null, "Wake up accepts on %s", this); resumeAccepts(); final NioTcpServerHandle[] handles = this.handles; final int idx = IoUtils.getThreadLocalRandom().nextInt(handles.length); handles[idx].wakeup(SelectionKey.OP_ACCEPT); }