¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Help with parsing


Chris Erskine
 

Along with what the others have said, SMTP is a line based protocol. That means that you want to gather a full line before you start the parsing.



Chris

-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of Steve Kaudle
Sent: Wednesday, January 28, 2009 1:29 PM
To: Crestron@...
Subject: [Crestron] Re: Help with parsing

It is possible that you're parsing routine isn't able to keep up with
changes at the buffer input.

I'd recommend using a single-threaded parsing method, like the 'joel
method', oft discussed 'round here in the past, or some sort of
semaphore routine so once the parsing routine is started, changes to
the buffer are ignored and/or treated differently until parsing is
complete.

Either way, shifting the contents of the buffer into a local string
variable, then working on that variable, is generally a good practice.

--- In Crestron@..., "bfschroe" <schroeder@...> wrote:

I am having some inconsistent trouble parsing a long serial "string".

Basically this is the SMTP parser I have been working on. It seems to
work mostly but every so often it misses something--e.g. doesn't find
the subject in the message.

I am running the TCP client feed from Simpl to a Change statement in
S+. The Rx$ connects to a buffer type variable in S+ and then I do
some basic parsing on that string.

Is it possible that the buffer is changing faster than the parser can
find the data? If so, what is the method to prevent this? Do I need to
create a local static copy of the text to parse so it isn't changing
between the program lines that "find" the text and extract it? Any
links to a parsing module that can handle a large string (?2000
character serial)

thanks

Bruce


------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links

Join [email protected] to automatically receive all group messages.