Indy 9
|
TIdStack = class
property LastError: Integer;
property LocalAddress: string;
property LocalAddresses: TStrings;
function CheckForSocketError(const AResult: integer = Id_SOCKET_ERROR): boolean; overload; function CheckForSocketError(const AResult: integer; const AIgnore: array of integer): boolean; overload;
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.
function CheckForSocketError(const AResult: integer = Id_SOCKET_ERROR): boolean; overload; function CheckForSocketError(const AResult: integer; const AIgnore: array of integer): boolean; overload;
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.
constructor Create; virtual; reintroduce;
function CreateSocketHandle(const ASocketType: Integer; const AProtocol: Integer = Id_IPPROTO_IP): TIdStackSocketHandle;
On the Windows platform, CreateSocketHandle calls the WSSocket function. If an error occurs while creating the new socket descriptor, an EIdInvalidSocket exception is raised.
class function CreateStack: TIdStack;
destructor Destroy; override;
function IsIP(AIP: string): boolean;
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.
procedure RaiseSocketError(const AErr: integer);
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
function ResolveHost(const AHost: string): string;
function StringToTInAddr(AIP: string): TIdInAddr;
function TInAddrToString(var AInAddr): string; virtual; abstract;
procedure TranslateStringToTInAddr(AIP: string; var AInAddr); virtual; abstract;
function WSAccept(ASocket: TIdStackSocketHandle; var VIP: string; var VPort: Integer): TIdStackSocketHandle; virtual; abstract;
function WSBind(ASocket: TIdStackSocketHandle; const AFamily: Integer; const AIP: string; const APort: Integer): Integer; virtual; abstract;
function WSCloseSocket(ASocket: TIdStackSocketHandle): Integer; virtual; abstract;
function WSConnect(const ASocket: TIdStackSocketHandle; const AFamily: Integer; const AIP: string; const APort: Integer): Integer; virtual; abstract;
function WSGetHostByAddr(const AAddress: string): string; virtual; abstract;
function WSGetHostByName(const AHostName: string): string; virtual; abstract;
function WSGetHostName: string; virtual; abstract;
function WSGetLastError: Integer; virtual; abstract;
procedure WSGetPeerName(ASocket: TIdStackSocketHandle; var AFamily: Integer; var AIP: string; var APort: Integer); virtual; abstract;
function WSGetServByName(const AServiceName: string): Integer; virtual; abstract;
function WSGetServByPort(const APortNumber: Integer): TStrings; virtual; abstract;
procedure WSGetSockName(ASocket: TIdStackSocketHandle; var AFamily: Integer; var AIP: string; var APort: Integer); virtual; abstract;
function WSGetSockOpt(ASocket: TIdStackSocketHandle; Alevel: Integer; AOptname: Integer; AOptval: PChar; var AOptlen: Integer): Integer; virtual; abstract;
function WSHToNL(AHostLong: LongWord): LongWord; virtual; abstract;
function WSHToNs(AHostShort: Word): Word; virtual; abstract;
function WSListen(ASocket: TIdStackSocketHandle; ABackLog: Integer): Integer; virtual; abstract;
function WSNToHL(ANetLong: LongWord): LongWord; virtual; abstract;
function WSNToHs(ANetShort: Word): Word; virtual; abstract;
function WSRecv(ASocket: TIdStackSocketHandle; var ABuffer; const ABufferLength: Integer; const AFlags: Integer): Integer; virtual; abstract;
function WSRecvFrom(const ASocket: TIdStackSocketHandle; var ABuffer; const ALength: Integer; const AFlags: Integer; var VIP: string; var VPort: Integer): Integer; virtual; abstract;
function WSSelect(ARead: TList; AWrite: TList; AErrors: TList; ATimeout: Integer): Integer; virtual; abstract;
function WSSend(ASocket: TIdStackSocketHandle; var ABuffer; const ABufferLength: Integer; const AFlags: Integer): Integer; virtual; abstract;
function WSSendTo(ASocket: TIdStackSocketHandle; var ABuffer; const ABufferLength: Integer; const AFlags: Integer; const AIP: string; const APort: integer): Integer; virtual; abstract;
function WSSetSockOpt(ASocket: TIdStackSocketHandle; ALevel: Integer; AOptName: Integer; AOptVal: PChar; AOptLen: Integer): Integer; virtual; abstract;
function WSShutdown(ASocket: TIdStackSocketHandle; AHow: Integer): Integer; virtual; abstract;
function WSSocket(AFamily: Integer; AStruct: Integer; AProtocol: Integer): TIdStackSocketHandle; virtual; abstract;
function WSTranslateSocketErrorMsg(const AErr: integer): string; virtual;