Subject: Re: IMAP with Asynchronous Sockets

From: Gangadhar Mylapuram <[email-masked]>
Date: Mon, 8 Sep 2003 06:19:55 -0700 (PDT)

Hi mark,

"Stop after current command finishes". Is this applicable to the following problem.

                ________                                _________
               I              |----------------------------->|                |
               I    MMI    |                               | Email       |
               I              |<-----------------------------|                |
               ----------------                               -----------------
 
The problem here is :
                                I have two taks,  Man machine interface(MMI) task sends user request to Email task through message queue. Through this message queue i have provison to receive asynchronous events (async+ non-blocking), these events tell whether send/recv/connect is success or failure. 
 
In Email task i have a while loop to receive request and events.
 
For example: 
User request is  "select folder" (from queue). Client has to  send user view of mails to MMI.
 
The sequence of commands need to execute by email client are (considering state of IMAP is authenticated)
 a.Select folder-name. (send and recv)
 b. Fetech 1:Max-Msgs (uid bodystructure envelope). (send and recv)
 c. close. (send and recv)
 
For each send and recv, i will receive an event form queue. I should not expect the result of send and recv immediatly.
 
 My problem is How to handle events.
 
How to use c-client routines in async+non-blocking mode?

Mark Crispin <[email-masked]> wrote:
On Wed, 3 Sep 2003, Gangadhar Mylapuram wrote:
> Requirment is use of asynchornous+ non bolocking sockets which handles
> abort requsts form user.

No. You don't want to abort that way. IMAP is a highly stateful protocol
and it is an extreme waste to discard sessions arbitrarily. That state is
expensive to build.

The correct mechanism is to use means such as partial fetching to reduce
potentially long tasks into shorter ones, and to implement an abort as a
"stop after the current command finishes".

-- Mark --

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

---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software