Hi Martin, Original message from: Martin Wilck <Martin.Wilck(a)fujitsu-siemens.com>
I have taken a closer look at this code. I believe a very similar approach is possible for Winsock. However, there are a few problems:
Good to see you are a man of action, not just words!
typedef struct async_private .. What do you think about this?
It would be cleaner to define a "general" async structure containing either a type-specific union or a pointer to type-specific data, and using void* for pointers. However, that would require even more changes in the async file I/O code, which I'd like to avoid at the moment.
i agree with you it would be better to use a union... i'll have a go at making a patch to do this. i'll probably understand the mess i've created in files/file.c more easily ;-)
Another difference is that the overlapped Winsock routines cause asynchronous success notification (i.e. calling the completion routine or signalling the lpOverlapped->hEvent) even if they are immediately successful, which seems not to be the case for asynchronous file I/O.
That would require a minor change in the check_async_list() routine.
Cool, go for it.
Please tell me your opinion!
Regards, Martin
i wrote a longer reply with a union definition in it, but accidently resized my Netscape window an lost it when the page reloaded :-( Could be about time to give up on this web-based email thing. Mike btw. in the patch in your other mail, you have: -typedef struct _OVERLAPPED * LPWSAOVERLAPPED; typedef HANDLE WSAEVENT; + +typedef struct _WSAOVERLAPPED { + DWORD Internal; + DWORD InternalHigh; + DWORD Offset; + DWORD OffsetHigh; + WSAEVENT hEvent; +} WSAOVERLAPPED, *LPWSAOVERLAPPED; + can you just use the following? typedef OVERLAPPED WSAOVERLAPPED; typedef LPOVERLAPPED LPWSAOVERLAPPED; typedef HANDLE WSAEVENT; or even #define... ------------------------------------------ mailto:Mike_McCormack(a)start.com.au ph +82 16 430 0425 __________________________________________________________________ Get your free Australian email account at http://www.Looksmart.com.au