Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Can you show the code where you are issuing and ending IO?</p> <p>Here is a possible workaround: Let's set the synchronizationcontext.current to null while you are beginning all IO operations. It looks like something in the .NET framework gets confused and is trying to restore the executioncontext twice.</p> <p>Here is some useful helper:</p> <pre><code> public static void ChangeSynchronizationContext(SynchronizationContext synchronizationContext, Action actionUnderSynchronizationContext) { var oldSyncContext = SynchronizationContext.Current; SynchronizationContext.SetSynchronizationContext(synchronizationContext); try { actionUnderSynchronizationContext(); } finally { SynchronizationContext.SetSynchronizationContext(oldSyncContext); } } </code></pre> <p>Call it like this:</p> <pre><code>ChangeSynchronizationContext(null, () =&gt; { /* start io */ }); </code></pre> <p>Another question: Are you nesting IO calls? Are you issuing many small IOs on this socket? I am asking this because the framework has a special case here:</p> <pre><code> if (currentThreadContext.m_NestedIOCount &gt;= 50) { ThreadPool.QueueUserWorkItem(new WaitCallback(this.WorkerThreadComplete)); flag = true; } else { this.m_AsyncCallback(this); } </code></pre> <p>This piece of code gives rise to the suspicion that there is a bug in the .NET framework in this rarely hit case. ThreadPool.QueueUserWorkItem will capture the current ExecutionContext and restore it later which is what we are seeing in the stack trace.</p>
    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.
    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