private ProcessReceivedBlob ( byte message, LazyAsyncResult lazyResult ) : void | ||
message | byte | |
lazyResult | LazyAsyncResult | |
Résultat | void |
private static void ReadCallback(IAsyncResult transportResult) { if (!(transportResult.AsyncState is LazyAsyncResult)) { NetEventSource.Fail(transportResult, "State type is wrong, expected LazyAsyncResult."); } if (transportResult.CompletedSynchronously) { return; } LazyAsyncResult lazyResult = (LazyAsyncResult)transportResult.AsyncState; // Async completion. try { NegoState authState = (NegoState)lazyResult.AsyncObject; byte[] message = authState._framer.EndReadMessage(transportResult); authState.ProcessReceivedBlob(message, lazyResult); } catch (Exception e) { if (lazyResult.InternalPeekCompleted) { // This will throw on a worker thread. throw; } lazyResult.InvokeCallback(e); } }
private static void ReadCallback(IAsyncResult transportResult) { if (!transportResult.CompletedSynchronously) { LazyAsyncResult asyncState = (LazyAsyncResult)transportResult.AsyncState; try { NegoState asyncObject = (NegoState)asyncState.AsyncObject; byte[] message = asyncObject._Framer.EndReadMessage(transportResult); asyncObject.ProcessReceivedBlob(message, asyncState); } catch (Exception exception) { if (asyncState.InternalPeekCompleted) { throw; } asyncState.InvokeCallback(exception); } } }