I am looking to do socket communications (listen, accept, connect, recv, send, disconnect) in both linux and windows. My project is in C, so unless someone can think of a way for me to integrate C++ libraries into a C project the library will have to be in C as well.
Ultimately, I would like the library to have ipv6 support and non-blocking mode, however, these things are not essential.
Does anyone know of any libraries/cross-platform example code? Even just large code snippets would help. So far the few socket libraries I have found have been in C++.
Off-hand, I can think of four libraries:
GLib Channels from the GLib framework can abstract socket usage, but you’ll need platform-specific code for socket creation.
libuv is a platform abstraction layer for node.js and handles, among other things, sockets and async IO.
The Apache Portable Runtime also contains network routines.
The Netscape Portable Runtime does socket manipulation as well.