/// <summary> Check the result code and throw an exception if needed.
///
/// If referral following is enabled, checks if we need to
/// follow a referral
///
/// </summary>
/// <param name="queue">- the message queue of the current response
///
/// </param>
/// <param name="cons">- the constraints that apply to the request
///
/// </param>
/// <param name="response">- the LdapResponse to check
/// </param>
private void chkResultCode(LdapMessageQueue queue, LdapConstraints cons, LdapResponse response)
{
if ((response.ResultCode == LdapException.REFERRAL) && cons.ReferralFollowing)
{
// Perform referral following and return
System.Collections.ArrayList refConn = null;
try
{
chaseReferral(queue, cons, response, response.Referrals, 0, false, null);
}
finally
{
releaseReferralConnections(refConn);
}
}
else
{
// Throws exception for non success result
response.chkResultCode();
}
return ;
}