AsynchronousByteCharChannel and Timeouts
Gili
cowwoc at bbs.darktech.org
Fri Jul 31 15:02:40 PDT 2009
Alan Bateman wrote:
>
> Another suggestion is to create a class that decorates a given
> AsynchronousByteChannel, extending it with methods for timed operations.
> You should be able to combine any AsynchronousByteChannel with the timer
> support in j.u.c and create a nice solution.
>
> -Alan.
>
I don't understand. Are you talking about adding functionality similar to
Future.get(long timeout) on top of an existing byte channel? I was talking
about the different between:
read(ByteBuffer dst, A attachment, CompletionHandler<Integer,? super A>
handler);
and
void read(ByteBuffer dst, long timeout, TimeUnit unit, A attachment,
CompletionHandler<Integer, ? super A> handler);
As far as I know you can't implement the latter in terms of the former
because you need to pass the timeout values to the underlying OS. What did
you mean?
Gili
--
View this message in context: http://n2.nabble.com/AsynchronousByteCharChannel-and-Timeouts-tp3363004p3365317.html
Sent from the nio-discuss mailing list archive at Nabble.com.
More information about the nio-discuss
mailing list