Why not make a CFFI library based around the C sockets library?
Wouldn't that be easier? That would avoid running into some implementation limitations too.