As part of my open-source BadVPN software project, I have developed an event-driven (single-threaded) cross-platform network programming framework for the C language. It uses epoll on Linux and IOCP on Windows.
Some important parts:
It makes heavy use of flow-based programming. For instance, BConnection, the abstraction of TCP, uses the StreamPassInterface and StreamRecvInterface general-purpose stream I/O interfaces. This is very useful; for instance, if you need to add SSL support to you application, little more is needed than throwing a BSSLConnection object on top of BConnection.
While most of the framework is well-documented, I don't yet provide any guides on how to use it. You can use this basic program as a starting point. While not intended for learning, the tun2socks program and especially the the accompanying smaller udpgw program might be useful.
Since you mentioned SOCKS, in my framework I've also implemeted a very simple SOCKS5 client (no authentication etc.) which is used by tun2socks.