modified socket_glue.c