add file socket.c

add c code