close the socket if needed when the body is skipped.