renamed socket_fd to sockfd