directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <>
Subject [asn1] Stateful Decoder question.
Date Wed, 05 Jan 2005 04:36:20 GMT

I'm developing an IMAP server in Java
( I'm currently building the I/O layer
before moving on to the higher level commands.

I've been communicating with Trustin as I'm currently using the MINA
framework (having migrated from Netty very recently).

IMAP has an interesting I/O model where most strings (and all mail
messages) can be transferred as 'literals'. Here's an example of a

Client: 001 LOGIN {8}\r\n
Server: + continue for 8 bytes.\r\n
Client: username\r\n{8}\r\n
Server: + continue for 8 bytes.\r\n
Client: password\r\n

Essentially, the client has to wait for a continuation message before
it can send the rest of the data (this is most useful for large
numbers of bytes, of course, but can occur for any number of bytes,
including zero).

I started building an IMAP grammar with Antlr which can handle a
useful subset of the full IMAP grammar and I'm happy with this
approach. The generated parser blocks for I/O if its input is
incomplete, so I need to decode in several passes.

My question (finally) is, is the StatefulDecoder work you're doing in
the Asn1 project applicable to my problem? I see that there's a basic
level that is Asn1-agnostic.

I'm keen to build a high-performance, non-blocking and elegant
solution to this problem, but I'm now thrashing backwards and forwards
for the right tool.

Any advice gratefully received,

View raw message