[...]异步和开始[...] .NET异步API之间的差异 [英] Difference between [...]Async and Begin[...] .net asynchronous APIs

查看:267
本文介绍了[...]异步和开始[...] .NET异步API之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能解释我之间有什么区别的开始[...] /结束[...]异步API的模式和以后[...]异步在.NET 3.5的模式?

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

  • 为什么后来产生的?
  • 为什么总会有preFER一个模式在另一个?

例如,Socket.BeginAccept()和Socket.AcceptAsync()。

For example, Socket.BeginAccept() and Socket.AcceptAsync().

推荐答案

MSDN会回答这个问题比我更好的:

MSDN will answer that better than me:

<一个href="http://msdn.microsoft.com/en-us/library/system.net.sockets.socketasynceventargs.aspx">http://msdn.microsoft.com/en-us/library/system.net.sockets.socketasynceventargs.aspx

这些增强功能的主要特点   是避免反复   分配和同步   在大批量的对象   异步套接字I / O。开始/结束   目前实现的设计模式   由System.Net.Sockets.Socket类   需要System.IAsyncResult对象   被分配给每个异步   插座操作。

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.

这篇关于[...]异步和开始[...] .NET异步API之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆