lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

the original socket API has (at least) one inherent flaw: it decouples
event notification from data delivery. This makes the API non-atomic.
This in turn leads to a number of race conditions. Most of them can
be worked around by the OS, but it's not reasonable to expect to be able
to fix all issues on any medium complex TCP/IP stack.

As much as I hate to say a good word about M$ products: The (native)
overlapped I/O API on Windows gets this right -- you get the event
notification _after_ the data is received into or sent from your user-space
buffer.

The standard socket API for Windows is just a (mediocre) compatibility
layer on top of it. Different OS internal event delivery paradigms are
at work here. Adapting between them leads to friction.

Bye,
     Mike