Update socket.c

Hey nigga, follow this method is portable to ipv6 !