Indy 9 | Content | Index | Reference

TIdStack
Hierarchy, Properties, Methods, See Also, Unit: IdStack
Ancestor for platform-specific protocol stack interfaces.

    TIdStack = class

Unit
IdStack
Description
TIdStack is an ancestor class for platform-specific protocol stack interfaces. This class is created and destroyed as needed. This is mentioned only because there a few useful low-level properties and methods.

TIdStack.LastError
TIdStack, See Also
Indicates the error number encounterd in a protocol stack operation.

    property LastError: Integer;

Return Value
Integer - numeric error number from the protocol stack.
Description
LastError is a read-only Integer property that indicates a previous return value from a protocol stack operation with the value Id_SOCKET_ERROR. LastError is updated in CheckForSocketError to contain the numeric result from WSGetLastError. LastError is generally used when the stack instance needs to call RaiseSocketError after encountering an error that is not handled by the protocol stack.

TIdStack.LocalAddress
TIdStack, See Also
Identifies the Host name or address for the local computer.

    property LocalAddress: string;

Description
LocalAddress is a read-only String property that contains the current host name or address. Use LocalAddresses to access all names or addresses assigned to the local computer.

TIdStack.LocalAddresses
TIdStack, See Also
List of host names for the local computer.

    property LocalAddresses: TStrings;

Description
LocalAddresses is a read-only TStrings property that is a list of all host names or IP addresses assigned for the local computer. Use LocalAddress to access the current host name or IP address for the local computer.

TIdStack.CheckForSocketError
TIdStack
Performs a check for specific socket error numbers.

    function CheckForSocketError(const AResult: integer = Id_SOCKET_ERROR): boolean; overload;
    function CheckForSocketError(const AResult: integer; const AIgnore: array of integer): boolean; overload;

Parameters
const AResult: integer = Id_SOCKET_ERROR
Error number to ne checked. Default value is Id_SOCKET_ERROR.
const AIgnore: array of integer
An array of inter socket error numbers to be ignored.
Return Value
Boolean - True when a the last error is ignored.
Description
CheckForSocketError is a Boolean function used to perform a check for specific socket error numbers. When AResult does not contain Id_SOCKET_ERROR or AIgnore is an empty array, all socket errors are detected.

If the last socket error is contained in AIgnore, the return value is True. Under all other conditions the return values is False. If a socket error si detected and not ignored, RaiseSocketError is called with the socket error number detected.

TIdStack.CheckForSocketError
TIdStack
Performs a check for specific socket error numbers.

    function CheckForSocketError(const AResult: integer = Id_SOCKET_ERROR): boolean; overload;
    function CheckForSocketError(const AResult: integer; const AIgnore: array of integer): boolean; overload;

Parameters
const AResult: integer = Id_SOCKET_ERROR
Error number to ne checked. Default value is Id_SOCKET_ERROR.
const AIgnore: array of integer
An array of inter socket error numbers to be ignored.
Return Value
Boolean - True when a the last error is ignored.
Description
CheckForSocketError is a Boolean function used to perform a check for specific socket error numbers. When AResult does not contain Id_SOCKET_ERROR or AIgnore is an empty array, all socket errors are detected.

If the last socket error is contained in AIgnore, the return value is True. Under all other conditions the return values is False. If a socket error si detected and not ignored, RaiseSocketError is called with the socket error number detected.

TIdStack.Create
TIdStack, See Also
Constructor for the object instance.

    constructor Create; virtual; reintroduce;

Description
Create is the constructor for the object instance. Create is an abstract method that must be overridden in descendant classes to provide any initialization sequences before using stack functions.

TIdStack.CreateSocketHandle
TIdStack
Creates a new socket descriptor.

    function CreateSocketHandle(const ASocketType: Integer; const AProtocol: Integer = Id_IPPROTO_IP): TIdStackSocketHandle;

Parameters
const ASocketType: Integer
Socket type for the descriptor.
const AProtocol: Integer = Id_IPPROTO_IP
Protocol family for the descriptor. Default value is Id_IPPROTO_IP.
Return Value
TIdStackSocketHandle - Newly created socket descriptor.
Description
CreateSocketHandle is a TIdStackSocketHandle function that create a new socket descriptor using the socket type specifies in AScoketType and the protocol family specified in AProtocol.

On the Windows platform, CreateSocketHandle calls the WSSocket function. If an error occurs while creating the new socket descriptor, an EIdInvalidSocket exception is raised.

TIdStack.CreateStack
TIdStack, See Also
Get a platform-specific protocol stack instance.

    class function CreateStack: TIdStack;

Description
CreateStack is a TIdStack class function that returns a TIdStack descendant for a specific platform. This is an internal procedure called by Indy and should not be used directly in an application.

TIdStack.Destroy
TIdStack, See Also
Frees the object instance.

    destructor Destroy; override;

Description
Destroy is the destructor for the object instance, and is overridden in descendant classes to provide any needed shut-down required for the protocol stack.

TIdStack.IsIP
TIdStack
Detects a numeric IP address.

    function IsIP(AIP: string): boolean;

Parameters
AIP: string
Host name or IP address to be checked.
Return Value
Boolean - True if the parameter is a numeric IP address.
Description
IsIP is a Boolean function that returns True if the string in AIP is a numeric IP address, or False if AIP contains a host name.

For example, if the value "129.71.2.4" is passed as AIP, this function will return True. If the value "wvnvm.wvnet.edu" is passed in AIP, this function will return False.

TIdStack.RaiseSocketError
TIdStack
Creates an exception for a socket error number.

    procedure RaiseSocketError(const AErr: integer);

Parameters
const AErr: integer
Socket error number to be raised.
Description
RaiseSocketError is a procedure that raises an EIdSocketError exception. RaiseSocketError uses the error code specified by the AErr integer parameter as the LastError parameter, and the translated socket error message for the AErr integer value.

Note: It is normal to receive a 10038 exception (10038, NOT others!) here when *shutting down* (NOT at other times!) servers (NOT clients!). If you receive a 10038 exception here please see the FAQ at http://www.nevrona.com/Indy/FAQ.html

If you DID read the FAQ and have further questions, please feel free to ask using one of the methods (Carefully note that these methods do not include email) listed on the Tech Support link at http://www.nevrona.com/Indy

TIdStack.ResolveHost
TIdStack
Convert a host name into an IP address.

    function ResolveHost(const AHost: string): string;

Parameters
const AHost: string
Host name to convert.
Return Value
String - IP address for the host name.
Description
ResolveHost is a String function that returns the IP address for a given host name specified by the AHost parameter. For example, if AHost is set to "wvnvm.wvnet.edu", the function will return "129.71.2.4". If AHost was set to 129.71.2.4", this function returns "129.71.2.4".

TIdStack.StringToTInAddr
TIdStack
Converts an string into a structured IP address.

    function StringToTInAddr(AIP: string): TIdInAddr;

Parameters
AIP: string
IP address string to be converted.
Return Value
TIdInAddr - IP address structure.
Description
StringToTInAddr is a TIdInAddr function that returns a structure containing the IP Address specified by the AIP parameter. This function is used Internally in Indy.

TIdStack.TInAddrToString
TIdStack
Converts an IP structure to a string.

    function TInAddrToString(var AInAddr): string; virtual; abstract;

Parameters
var AInAddr
IP address structure to convert.
Return Value
String - String containing the converted IP address.
Description
TInAddrToString is a String function that returns an IP address as a string from a TInAddr structure. This is used internally in Indy so you do not call this directly.

TIdStack.TranslateStringToTInAddr
TIdStack
Translates a string a creates an IP address structure.

    procedure TranslateStringToTInAddr(AIP: string; var AInAddr); virtual; abstract;

Parameters
AIP: string
String to be translated and converted.
var AInAddr
IP address structure for the converted value.
Description
TranslateStringToTInAddr that translates an IP address from the string parameter AIP and returns it in the TInAddr specified by the AInAddr parameter. This is used internally in Indy so you do not call this directly.

TIdStack.WSAccept
TIdStack

    function WSAccept(ASocket: TIdStackSocketHandle; var VIP: string; var VPort: Integer): TIdStackSocketHandle; virtual; abstract;

Description
WSAccept

TIdStack.WSBind
TIdStack

    function WSBind(ASocket: TIdStackSocketHandle; const AFamily: Integer; const AIP: string; const APort: Integer): Integer; virtual; abstract;

Description
WSBind

TIdStack.WSCloseSocket
TIdStack

    function WSCloseSocket(ASocket: TIdStackSocketHandle): Integer; virtual; abstract;

Description
WSCloseSocket

TIdStack.WSConnect
TIdStack

    function WSConnect(const ASocket: TIdStackSocketHandle; const AFamily: Integer; const AIP: string; const APort: Integer): Integer; virtual; abstract;

Description
WSConnect

TIdStack.WSGetHostByAddr
TIdStack

    function WSGetHostByAddr(const AAddress: string): string; virtual; abstract;

Description
WSGetHostByAddr

TIdStack.WSGetHostByName
TIdStack

    function WSGetHostByName(const AHostName: string): string; virtual; abstract;

Description
WSGetHostByName

TIdStack.WSGetHostName
TIdStack

    function WSGetHostName: string; virtual; abstract;

Description
WSGetHostName

TIdStack.WSGetLastError
TIdStack

    function WSGetLastError: Integer; virtual; abstract;

Description
WSGetLastError

TIdStack.WSGetPeerName
TIdStack

    procedure WSGetPeerName(ASocket: TIdStackSocketHandle; var AFamily: Integer; var AIP: string; var APort: Integer); virtual; abstract;

Description
WSGetPeerName

TIdStack.WSGetServByName
TIdStack

    function WSGetServByName(const AServiceName: string): Integer; virtual; abstract;

Description
WSGetServByName

TIdStack.WSGetServByPort
TIdStack

    function WSGetServByPort(const APortNumber: Integer): TStrings; virtual; abstract;

Description
WSGetServByPort

TIdStack.WSGetSockName
TIdStack

    procedure WSGetSockName(ASocket: TIdStackSocketHandle; var AFamily: Integer; var AIP: string; var APort: Integer); virtual; abstract;

Description
WSGetSockName

TIdStack.WSGetSockOpt
TIdStack

    function WSGetSockOpt(ASocket: TIdStackSocketHandle; Alevel: Integer; AOptname: Integer; AOptval: PChar; var AOptlen: Integer): Integer; virtual; abstract;

Description
WSGetSockOpt

TIdStack.WSHToNL
TIdStack

    function WSHToNL(AHostLong: LongWord): LongWord; virtual; abstract;

Description
WSHToNL

TIdStack.WSHToNs
TIdStack

    function WSHToNs(AHostShort: Word): Word; virtual; abstract;

Description
WSHToNs

TIdStack.WSListen
TIdStack

    function WSListen(ASocket: TIdStackSocketHandle; ABackLog: Integer): Integer; virtual; abstract;

Description
WSListen

TIdStack.WSNToHL
TIdStack

    function WSNToHL(ANetLong: LongWord): LongWord; virtual; abstract;

Description
WSNToHL

TIdStack.WSNToHs
TIdStack

    function WSNToHs(ANetShort: Word): Word; virtual; abstract;

Description
WSNToHs

TIdStack.WSRecv
TIdStack

    function WSRecv(ASocket: TIdStackSocketHandle; var ABuffer; const ABufferLength: Integer; const AFlags: Integer): Integer; virtual; abstract;

Description
WSRecv

TIdStack.WSRecvFrom
TIdStack

    function WSRecvFrom(const ASocket: TIdStackSocketHandle; var ABuffer; const ALength: Integer; const AFlags: Integer; var VIP: string; var VPort: Integer): Integer; virtual; abstract;

Description
WSRecvFrom

TIdStack.WSSelect
TIdStack

    function WSSelect(ARead: TList; AWrite: TList; AErrors: TList; ATimeout: Integer): Integer; virtual; abstract;

Description
WSSelect

TIdStack.WSSend
TIdStack

    function WSSend(ASocket: TIdStackSocketHandle; var ABuffer; const ABufferLength: Integer; const AFlags: Integer): Integer; virtual; abstract;

Description
WSSend

TIdStack.WSSendTo
TIdStack

    function WSSendTo(ASocket: TIdStackSocketHandle; var ABuffer; const ABufferLength: Integer; const AFlags: Integer; const AIP: string; const APort: integer): Integer; virtual; abstract;

Description
WSSendTo

TIdStack.WSSetSockOpt
TIdStack

    function WSSetSockOpt(ASocket: TIdStackSocketHandle; ALevel: Integer; AOptName: Integer; AOptVal: PChar; AOptLen: Integer): Integer; virtual; abstract;

Description
WSSetSockOpt

TIdStack.WSShutdown
TIdStack

    function WSShutdown(ASocket: TIdStackSocketHandle; AHow: Integer): Integer; virtual; abstract;

Description
WSShutdown

TIdStack.WSSocket
TIdStack

    function WSSocket(AFamily: Integer; AStruct: Integer; AProtocol: Integer): TIdStackSocketHandle; virtual; abstract;

Description
WSSocket

TIdStack.WSTranslateSocketErrorMsg
TIdStack

    function WSTranslateSocketErrorMsg(const AErr: integer): string; virtual;

Description
WSTranslateSocketErrorMsg

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.