New file socketutils.c added