Topic Path: Symbol Reference > Classes > TIdStackBSDBase Class > TIdStackBSDBase Methods > CheckForSocketError Method > CheckForSocketError Method (Integer, array of Integer)
TIdStackBSDBase.CheckForSocketError Method (Integer, array of Integer)

Determines if a numeric response indicates a socket error has occurred.

function CheckForSocketError(
    const AResult: Integer; 
    const AIgnore: array of Integer
): Integer; overload;
Numeric respond code to check for a socket error number.
Numeric responses to ignore as socket errors. 

Integer - The numeric response code when no socket error has occurred, or the error number is ignored.

CheckForSocketError is an overloaded Integer function used to determine if the numeric value in AResult indicates that a socket error has occurred. When AResult contains the constant value Id_SOCKET_ERROR, the value from WSGetLastError is compared to the elements in AIgnore. If AResult is not found in AIgnore, the RaiseSocketError method is called using the value returned from WSGetLastError

The return value for CheckForSocketError is the value in AResult when no socket error has occurred, or the value from WSGetLastError when it occurs in AIgnore. 

CheckForSocketError is used in NewSocketHandle to determine if a socket handle was successfully allocated for the desired IP family, socket type, protocol, and IO mode. 

CheckForSocketError is used in Receive to determine if the read operation was successfully completed.




Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.