Difference between […]Async and Begin[…] .net asynchronous APIs

前端 未结 2 1441
春和景丽
春和景丽 2020-12-31 03:17

Can anybody explain me what is the difference between the Begin[...]/End[...] asynchronous API pattern and the later [...]Async pattern in .NET 3.5?

  • Why was th
2条回答
  •  执念已碎
    2020-12-31 03:53

    MSDN will answer that better than me:

    http://msdn.microsoft.com/en-us/library/system.net.sockets.socketasynceventargs.aspx

    The main feature of these enhancements is the avoidance of the repeated allocation and synchronization of objects during high-volume asynchronous socket I/O. The Begin/End design pattern currently implemented by the System.Net.Sockets.Socket class requires a System.IAsyncResult object be allocated for each asynchronous socket operation.

提交回复
热议问题