fdsapi: implement basic socket I/O