5 ms·
Are there really no applications for using low-level async I/O APIs/syscalls? Embedded systems? Game servers? Proxies? Software routers? Hidden command & c
by linkregister 9y ago
Are there really no applications for using low-level async I/O APIs/syscalls? Embedded systems? Game servers? Proxies? Software routers? Hidden command & control servers?
- peterwwillis 9y agoSo in other words, when is it appropriate to avoid using a pre-coded, pre-tested, independently-supported, documented, stable set of code designed to work in a variety of situations as well as it can? When it's not designed for what you need it to do. But i/o libraries are designed for all cases of select() I can think of. The only time you shouldn't use a library, then, is when it literally doesn't work for you. In that case you should modify the library to add support for what you need, get it upstream, and use the library. Even if you decide using a library isn't right for you, you should at least read the source code of a library to see how they would have done it.
- linkregister 9y agoYou're right with this comment. There have been times when I would have benefitted by looking at a library's code even when it didn't fit what I was trying to do. What libraries do you recommend to replace async io system calls in C?
- MrBuddyCasino 9y agoFor embedded systems, LWIP has a socket API that supports select(). Try finding an event library for that one! I had to roll my own, and I learned quite a bit in the process.
- Matthias247 9y agoActually if you use the low-level LWIP (sometimes called Raw API) instead of the socket API it will be actually event-driven (singlethreaded, callback-driven, etc.) by design. The socket abstraction layer on top of it then provides blocking APIs and multithreading support - with the cost of a lower performance.
- MrBuddyCasino 9y agoI'm planning to eventually migrate to the netconn API, but was deterred by a lack of documentation. Do you know of any sources? This doesn't help much: http://www.nongnu.org/lwip/2_0_x/index.html http://www.nongnu.org/lwip/2_0_x/index.html
- Matthias247 9y agoI also had quite some hard time with the lack of documentation for LWIP. The only other source that I found was the Wiki which is also linked there: http://lwip.wikia.com/wiki/LwIP_Wiki http://lwip.wikia.com/wiki/LwIP_Wiki But I still had to figure out lots of things from the actual code.
- MrBuddyCasino 9y agoRats. I had a feeling you'd say that, thanks!
- Matthias247 9y agoI found something more in my work bookmarks: http://www.atmel.com/Images/Atmel-42233-Using-the-lwIP-Network-Stack_AP-Note_AT04055.pdf http://www.atmel.com/Images/Atmel-42233-Using-the-lwIP-Netwo... Maybe it also has some extra information which can help.