Re: Overlapped file IO

Dan Farino <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <06CE4E670D914B46B61200C7B9733DDD60E70D@fegplmsexmb13.ffe.foxeg.com>
Yes it does (except on Windows 9x). For FileStream, use the constructor:

public FileStream(string path, FileMode mode, FileSystemRights rights,
FileShare share, int bufferSize, FileOptions options)

Make sure you pass in FileOptions.Asynchronous. Then, use
BeginRead/Write and EndRead/Write. This uses overlapped I/O. (The only
part that is still synchronous is the constructor since there is no
async version of the underlying CreateFile Win32 call.)

Other classes such as Socket also use overlapped I/O when you use
BeginXXX/EndXXX. In the case of Socket and others, you don't need to
pass any special flags in like you have to with FileStream's
FileOptions.

-----Original Message-----
From: Discussion of development on the .NET platform using any managed
language [mailto:[email protected]] On Behalf Of Alex
Ivanoff
Sent: Monday, November 19, 2007 2:44 PM
To: [email protected]
Subject: [DOTNET-CLR] Overlapped file IO

Does .NET 2.0 have support for overlapped IO or do I need to implement
one myself?

Alex

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.