add write, read in socket_glue.c