Hi, Adam:

Thank you for pointing me to AsyncWeb - really interesting stuff!  I found ConsumeToCRLFDecoder and ConsumeToCharacterDecoder, but no ConsumeToDynamicTerminatorDecodingState.  Any idea where I might find this?

BTW, I have already coded some of my driver using state machines, and am 100% sold on this way of doing things.  It is amazingly efficient for managing i/o transactions of arbitrary duration because it does not keep threads waiting.

- Yigal


Adam Fisk wrote:
I'd give the state machine in AsyncWeb a look, as well as some of the helper
classes.  The state machine approach takes awhile to wrap your head around
if you're not used to it, but it works well.  The
"ConsumeToDynamicTerminatorDecodingState" helper class will do exactly what
you want.  You would need to write a fair bit of custom state machine code
for your protocol going this route, but I think it's worth it.

http://docs.safehaus.org/display/ASYNCWEB/Home

-Adam


On 8/9/07, Yigal Rachman <[EMAIL PROTECTED]> wrote:
  
Hi, Folks:

I have a MINA client that acts as a driver for a scientific instrument.
The communication is via a serial link using ASCII.  The messages from
the instrument are usually terminated with a line feed, but are
sometimes terminated with a ">" instead (when it is prompting for
commands).

Could you please suggest a design pattern that would do this elegantly
in MINA?  I expect it will use the TextLineCodec and possibly some other
filters, but I am fuzzy on the details.

Best regards,
Yigal Rachman

DMAS Data Acquisition Developer
NEPTUNE Canada
University of Victoria,
Victoria, BC, Canada
www.neptunecanada.ca

    

  

Reply via email to