Know of any cross platform socket library (windows & Linux) in C? Know of any cross platform socket library (windows & Linux) in C? c c

Know of any cross platform socket library (windows & Linux) in C?


Off-hand, I can think of four libraries:


The plibsys library provides all the requested features: cross-platform and portable, lightweight, provides socket IPv4 and IPv6 support as well as many other useful things like multithreading. Works with sockets in non-blocking mode (though you can switch to a blocking one, too). Has quite a good documentation with the test code examples.


I don't know one library that complies both Windows and Linux but I think winsock is similar enough to Linux socket programming.

In particular it supplies you 'select()' and the other functions mentioned. I guess you will need a very thin #ifdef wrapper to avoid type casting warnings.

See here the winsock page for select