|
Event Objects
Introducing overlapped I/O requires a mechanism for applications to
unambiguously associate send and receive requests with their subsequent completion
indications. In Windows Sockets 2, this is accomplished with event objects that are
modeled after Win32 events. Windows Sockets event objects are fairly simple
constructs that can be created and closed, set and cleared, and waited upon and
polled. Their prime utility is the ability of an application to block and wait
until one or more event objects become set.
Applications use WSACreateEvent to obtain an event object handle that can then be supplied as a required
parameter to the overlapped versions of send and receive calls (WSASend, WSASendTo, WSARecv, WSARecvFrom). The event object, which is cleared when first created, is set by the
transport providers when the associated overlapped I/O operation has completed
(either successfully or with errors). Each event object created by WSACreateEvent should have a matching WSACloseEvent to destroy it.
Event objects are also used in WSAEventSelect to associate one or more FD_XXX network events with an event object. This is
described in Asynchronous Notification Using Event Objects.
In 32-bit environments, event object related functions, including WSACreateEvent, WSACloseEvent, WSASetEvent, WSAResetEvent, WSAWaitForMultipleEvents, and WSAGetOverlappedResult, are directly mapped to the corresponding native Win32 functions, using the
same function name, but without the WSA prefix.
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
More Online Helps
Win32 Programmer's Reference (win32.hlp)
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|