mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yigal Rachman <yi...@uvic.ca>
Subject Re: How to deal with dynamically changing line terminators?
Date Mon, 13 Aug 2007 17:41:18 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
Hi, Adam:<br>
Thank you for pointing me to AsyncWeb - really interesting stuff!&nbsp; I
found ConsumeToCRLFDecoder and ConsumeToCharacterDecoder, but no
ConsumeToDynamicTerminatorDecodingState.&nbsp; Any idea where I might find
BTW, I have already coded some of my driver using state machines, and
am 100% sold on this way of doing things.&nbsp; It is amazingly efficient
for managing i/o transactions of arbitrary duration because it does not
keep threads waiting.<br>
- Yigal<br>
Adam Fisk wrote:
  <pre wrap="">I'd give the state machine in AsyncWeb a look, as well as some of the
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.

<a class="moz-txt-link-freetext" href="http://docs.safehaus.org/display/ASYNCWEB/Home">http://docs.safehaus.org/display/ASYNCWEB/Home</a>


On 8/9/07, Yigal Rachman <a class="moz-txt-link-rfc2396E" href="mailto:yigal@uvic.ca">&lt;yigal@uvic.ca&gt;</a>
  <blockquote type="cite">
    <pre wrap="">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 "&gt;" instead (when it is prompting for

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
University of Victoria,
Victoria, BC, Canada
<a class="moz-txt-link-abbreviated" href="http://www.neptunecanada.ca">www.neptunecanada.ca</a>

  <pre wrap=""><!---->

View raw message