add file socket.c
Merge pull request #2 from danial-cao/master

add file socket.c