"... I need their asynchronous copies, but they just don't exist. Why?"
All XXXAsync methods that have been added to the .Net infrastructure along with asynchronous waiting (not counting new libraries designed with asynchrony in mind) are just wrappers around BeginXXX / EndXXX .
They did not add any new asynchronous operations, but simply turned the old into new, task-based. For example, this is UdpClient.SendAsync :
public Task<int> SendAsync(byte[] datagram, int bytes) { return Task<int>.Factory.FromAsync(BeginSend, EndSend, datagram, bytes, null); }
Since there is no File.BeginReadAll and File.EndReadAll , it is clear that there is no File.ReadAllAsync .
Are there any pitfalls?
The only mistake in implementing these methods is to make it truly asynchronous, not fake async.
source share