1. 06 1月, 2017 10 次提交
  2. 05 1月, 2017 29 次提交
  3. 04 1月, 2017 1 次提交
    • S
      Change SslStream to use Read/WriteAsync on inner stream · dab9b807
      Stephen Toub 提交于
      In .NET Core 1.x, SslStream's usage of Begin/EndRead/Write was actually using extension methods that just used TaskToApm.Begin/End with Read/WriteAsync.  When the base Stream's Begin/EndRead/Write methods were added back, SslStream's usage of these methods started binding to the base methods, such that it was no longer using the inner stream's Read/WriteAsync.
      
      This change explicitly switches all of those calls (for both SslStream and NegotiateStream) to use Read/WriteAsync.  A better solution is to actually add SslStream.Read/WriteAsync overrides that use async/await and tasks all the way down, rather than going back and forth between Tasks and APM, but that is a more complicated work item.  This addressesses the immediate need (problems related to deadlocks on SslStream when read and writes are issued to run concurrently on the same stream) and can be undone or augmented subsequently when a better solution is available.
      
      This is at least as good performance-wise as what we had in .NET Core 1.x, and in some cases is a bit better, as we can avoid creating the IAsyncResult wrapper in some cases if the returned task is already completed.
      
      
      Commit migrated from https://github.com/dotnet/corefx/commit/856fb3dae9be9f30fc74aa152c64ff28bfbf6041
      dab9b807