AsynchronousByteCharChannel and Timeouts

Gili cowwoc at bbs.darktech.org
Sat Aug 1 14:59:19 PDT 2009



Alan Bateman wrote:
> 
> You should be able to implement the timed variants using the non-timed 
> methods when combined with the timer support in java.util.concurrent. 
> That's what we do in the AsynchronousSocketChannel implementation and 
> should be applicable to other channel types too. All I was suggesting is 
> that this might be something useful to add to your library.
> 

I wonder if this is a difference between socket communications and serial
ports. As far as I know, there is no way for me to initiate a "wait forever"
read against a serial port and then fire some method at a later time asking
it to return as much data has it managed to gather so far.

Looking at http://msdn.microsoft.com/en-us/library/aa363437%28VS.85%29.aspx
and http://msdn.microsoft.com/en-us/library/aa363791%28VS.85%29.aspx it
seems that if you cancel a read (the only way I know of interrupting it) the
operation will return zero bytes. Am I missing something?

Thanks,
Gili
-- 
View this message in context: http://n2.nabble.com/AsynchronousByteCharChannel-and-Timeouts-tp3363004p3370772.html
Sent from the nio-discuss mailing list archive at Nabble.com.



More information about the nio-discuss mailing list