TRQ-2173. Make add_connection() do parameter checking to see if the socket is a valid socket index.