void attemptReceive(long timeout, TimeUnit unit) throws SuspendExecution, InterruptedException, TimeoutException, EOFException {
checkClosed();
final Condition sync = channel.sync;
long left = unit.toNanos(timeout);
final long deadline = System.nanoTime() + left;
Object token = sync.register();
try {
for (int i = 0; !consumer.hasNext(); i++) {
if (channel.isSendClosed()) {
setReceiveClosed();
checkClosed();