[Gambas-user] A Task Issue
Benoît Minisini
g4mba5 at gmail.com
Wed Mar 7 12:18:49 CET 2018
Le 07/03/2018 à 10:21, Jorge Carrión a écrit :
> Hi everyone,
> I'm doing a Mail Checker using a task. It checks Mail in a timer
> interval of 10 seconds and send a desktop notify if there is new
> incoming mail. It seems work well but after a time it hangs.
> The check mail process is done by a task and I guess that there is
> something I missed about handling tasks.
>
> Each time the task checks mail a process of openssl remains open even
> the task is stoped and/or destroyed (null).
>
> Someone can help me about this? I've attached a little working example
> and the picture of the process list remaining after each mail check.
>
> Thanks in advance
>
> Best Regards
>
>
What you didn't understand is that a Task does not run in the same process!
If you call tc.CheckMail() from the main process, you just run the
method in the main process. The task does nothing. Only the task Main()
method is automatically called in the task context (and then every other
method called from the Main() method).
And you have to close the Pop3Client in all cases, which you do not,
check your code. I think this is the reason why the openssl processes
still run.
--
Benoît Minisini
More information about the User
mailing list