Timer & Not responding issue
Posted: Mon Feb 05, 2018 11:03 am
We have successfully converted our mailreader to X#. We do have one issue, which was already the case in the Vulcan program, but maybe someone can comment on it. The program reads the mail every (x) seconds (which can be set). It stores the mails in a DBF and separately stores an eml. file; the VO program only needs to refresh the (b)browser to show the latest changes.
To work, the X# program users a timer, like this:
SELF:oReadTimer := DispatcherTimer{}
SELF:oReadTimer:Tick += System.EventHandler{SELF, @TimerTick()}
SELF:oReadTimer:Interval := TimeSpan{0, 0, INT(SELF:iTimeBetween)}
SELF:oReadTimer:Start()
When we run the program on a Server 2012, it will soon show as "Not responding" in the Task Manager and it won't react on keyboard input either. The same program does not have that problem on Windows 10 systems for example.
What can cause this difference?
I was thinking about moving the read process to Asycn tasks but I am not sure if this will work in Vulcan dialect X# - does Asycn work there or does it need to be Core X# for it?
Dick
To work, the X# program users a timer, like this:
SELF:oReadTimer := DispatcherTimer{}
SELF:oReadTimer:Tick += System.EventHandler{SELF, @TimerTick()}
SELF:oReadTimer:Interval := TimeSpan{0, 0, INT(SELF:iTimeBetween)}
SELF:oReadTimer:Start()
When we run the program on a Server 2012, it will soon show as "Not responding" in the Task Manager and it won't react on keyboard input either. The same program does not have that problem on Windows 10 systems for example.
What can cause this difference?
I was thinking about moving the read process to Asycn tasks but I am not sure if this will work in Vulcan dialect X# - does Asycn work there or does it need to be Core X# for it?
Dick