Validate the connection expected length before using it