"Rocco Caputo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dylan Hardison asked on IRC whether it was possible to limit the > length of an input line using POE::Filter::Line. I admitted that it's > not currently an option but could become one. > > We put down some ideas about what to do with long lines. Four > possibilities came up: > > Ignore the excess characters on a line. Return a truncated line > with no exception. > > Same as #1, but with some sort of marker signaling an exception. > > Discard the long line entirely. Don't return anything, and don't > throw an exception. > > Same as the preceding, but with an exception marker attached. >
Using the filter as just a tool to truncate long lines seems counter to the general goal of being a protocol abstraction layer. However, if the protocol is in fact "lines less than N bytes", the behavior when seeing a longer line should be the same as when POE::Filter::Reference sees a stream of bytes it can't thaw. Ideally, I would love to see any exceptions in the protocol be handled by the same mechanism as any error by triggering the ErrorEvent of the wheel, or creating a new FilterError event that can be triggered whenever a Filter class throws an exception. --Ben Kennedy