tags:

views:

21

answers:

0

How can one implement read(ByteBuffer dst, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler) on top of an existing AsynchronousByteChannel?

That is, how can one implement read-with-timeout functionality on top of AsynchronousByteChannel that does not support timeouts?

Unlike AsynchronousSocketChannel I don't want to be forced to close a channel after a read-timeout. Ideally I should be able to retry the read without closing the channel.