Picking the right API for native-code portability is a crucial decision. The Apache Portable Runtime (APR) provides a free and commercial-friendly choice for this sort of thing. What's more, it's got some miles under its belt, having been a part of Apache web server development for many years. Ethan McCallum demonstrates its use in his article "APR Networking & the Reactor Pattern."