Warning! Horrendous geekery! ... Multiple-socket systems (eg. any sort of server) suck, on every operating system except BSD. The only universally compatible method is using "select" which is horrible, whether blocking or polling. Linux also allows "poll", which is incompatible with many other systems, and sucks nearly as badly as a polling select anyway. Then there's the aio functions, which are akin to Windows Overlapped IO, in that they require that preallocated buffers be sacrificed to them, and then they report back in a fucking awkward manner. Windows also has its WSAAsyncSelect method, with reporting to either a window or an event; the former is lovely, it queues up messages in the order of occurence nicely, but it can't be used in a proper server because services aren't supposed to use any windows. The latter method, reporting to events, sucks. What's BSD's method that doesn't suck? kqueue and kevent - the same as Windows' AsyncSelect using a window, except without requiring the existence of a window. Is that so hard? Is it? But if I want that sort of ridiculously simple and sensible behaviour for many operating systems, I have to write a bloody big library to emulate the effect. And emulate it shittily, since it will have all the non-scalability of whatever method I use behind the scenes.
[21:35]
|