The correct way of looking at IMAP is to see it as two protocols.

One protocol sends commands from the client, and at some later time it
gets a completion response from the server.  The client may send more than
one command at a time if the execution order of those commands does not
matter (refer to the text in RFC 3501 about multiple commands in progess).

The other protocol receives data from the server, and updates the client's
cache of the data.

Non-blocking sockets can be used to implement this.

This does not lend itself to an FSM very well.  A queue is a better model.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

Reply via email to