I'm wondering, what's the best way in POE to handle a multi-line protocol, essentially I have input that looks like this, which is handled in my code by a ReadWrite session spawned from a Wheel::SocketFactory connection:

CMD- arg1 arg2 ...
  ... arbitrary number of lines here ...
CMD END

My question is, what's the best way to collect the multiple lines before parsing? I'm thinking an arrayref in the ReadWrite session, that parses/flushes once I hit the END line ... I could certainly make something like that work with my limited POE knowledge, but maybe there's a more better ... or innate-to-POE way of handling this type of situation?

Thanks,
-john



Reply via email to