Menu

#189 Make pop3 non-blocking

open
pop3 (3)
5
2004-11-07
2004-11-07
No

Hi,

I was using tcllib code for a plugin in amsn* to check
pop3 email. The problem was that every time the email
was checked it blocked amsn while it was checking.
Therefore I suggest changing the code such that it is
non-blocking. I have made a start (and possibly all the
changes necessary). I made the ::pop3::open, and
::pop3::send both non-blocking which I think should
then include all other functions (haven't looked)?

Just note that I知 not sure which version of pop3 I
started with (someone else copied the code originally).
Also in trying to make it non-blocking I went around in
a couple of circles before getting it correct, so may
have removed some code that could be reinserted.

Now that it is complete it is not so hard to
understand, and I recommend having a look at what I
have done and possibly implementing it into pop3 in tcllib.

Also to note, the way I have done it (to make it
simpler) was that it is blocking to the calling process
but not the program in entirety. This was ok for what I
was doing as the calls to it were done by the after
command which creates a new process and doesn't block
the whole program.

If you have any comments or questions don't hesistate
to contact me at my sf email. Or by posting here.

Lio.

*PS The code was copied and a reference that the code
was from tcllib was made, hope this is ok? if not tell
me and I will remove.

Discussion

  • Andreas Kupries

    Andreas Kupries - 2004-11-08

    Logged In: YES
    user_id=75003

    You can see which version of pop3 you have by looking at the
    'package provide' statement in the file, either at the top,
    or the bottom. There should also be a line like 'RCS: @(#)
    ...' This line contains an internal revision number, just
    before the modification date.

    I cannot look at what you have done because you did not
    attach a file with your changes to this report.

    However if I understand your description correctly you are
    using 'vwait' to enter a new/nested event loop to both wait
    for the response from the server and to process events at
    the same time.

    Having a reference back to tcllib is ok (An url would be
    very good, not clear from description :)

    I have some ideas myself, so I don't know if I will use your
    stuff. It is definitely something which I want to do,
    however not right now. Maybe over X-mas.