Improve check for type of socket length (socklen_t).