PDA

View Full Version : Stopping the download process during pop3 session.



kremuwa
28th July 2010, 14:54
Hello.

In my peer2mail client, each file added to download starts a new thread and in this thread it establishes connection with the pop3 server, checks attachments' names using TOP command and then starts to download proper mails using RETR command, one by one. But I want to add an option for an user to stop the downloading process of specific file immediately and remove all the info related to that file from the user interface. I know how to do the interface part but I'm wondering what should I do to stop downloading mails immediately - should i use QUIT command (don't think so, cause it'll probably not work while reading the responce for RETR command)? Or should I call abort() function to disconnect immediately? What do you think?

Thank you in advance.

squidge
28th July 2010, 17:26
Yes, I'd close the socket on user abort and let the server detect that. It's not going to respond to a quit command whilst still processing the previous command.

kremuwa
28th July 2010, 23:41
What does it mean: "let the server detect that"? I tried to call abort a few days ago but the reason I asked this question is that I was given a thread-related error. I don't remember it precisely so I'll let you know about it when I'll see it again. It seems it's all because of threads... but I don't want to resign from using them now.