global sockfd and close