Note that there are some explanatory texts on larger screens.

plurals
  1. POWin App using Background worker process running on Terminal Server goes Non responsive
    primarykey
    data
    text
    <p>There is a Win app tool(C#) running at terminal server which is used to download mails, process the attachment in it and update its UI. Downloading and processing of mail attachments is done using the Background Worker process which also responsible for updating the UI with mails and attachments total and processed count at that instance. There is a timer which ticks to re-initializes the same background worker process after specified duration and look for new mails.</p> <p>All works fine till the time I am logged in RDC, but when I lock the system (Window key+L) or switch users and comeback to regain the same session the tool is stuck/non responsive, it happens even if I lock and unlock the system instantaneously. I used another process monitoring tool which initially showed child threads getting created and exited periodically but after it is stuck no activity is shown.</p> <p>I have no clue why is it happening, is window messing is stopped or UI Controls handle are lost or or or....</p> <p>Following are the chunks of code I am using:</p> <pre><code>private void tmrScheduler_Tick(object sender, EventArgs e) { Application.DoEvents(); if (bgwMailParser == null || (!bgwMailParser.IsBusy &amp;&amp; !objfeMailImportNParse.Is_Parsing)) { bgwMailParser = new BackgroundWorker(); bgwMailParser.DoWork += new DoWorkEventHandler(objfeMailImportNParse.opLoadCommonData); bgwMailParser.DoWork += new DoWorkEventHandler(objfeMailImportNParse.StartMailImport); if (HireCraft.Properties.Settings.Default.Close_App_After_Parsing) bgwMailParser.RunWorkerCompleted += new RunWorkerCompletedEventHandler(opCloseApplication); bgwMailParser.RunWorkerCompleted += new RunWorkerCompletedEventHandler(opDisposeWorker); bgwMailParser.RunWorkerAsync(); } Application.DoEvents(); } </code></pre> <p>below method handles the events raised by bgWorker process</p> <pre><code>private delegate void Del_updateParsedCounter(Int64 del_MailCount, Int64 del_AttchCount); private void UpdateParsedCounter(Int64 MailCount, Int64 AttchCount) { try { if (lblMailParsedCount.InvokeRequired) { Del_updateParsedCounter objUpdateParsedCounter = new Del_updateParsedCounter(UpdateParsedCounter); this.Invoke(objUpdateParsedCounter, new object[] { MailCount, AttchCount }); } else { lblMailParsedCount.Text = MailCount.ToString(); lblAttchSavedCount.Text = AttchCount.ToString(); } } catch (Exception ex) { Debug.Assert(false, ex.Message, ex.StackTrace); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload