// Borland C++ Builder
// Copyright (c) 1995, 2005 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Instackwindows.pas' rev: 10.00

#ifndef InstackwindowsHPP
#define InstackwindowsHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Inglobal.hpp>	// Pascal unit
#include <Inexception.hpp>	// Pascal unit
#include <Instackbsdbase.hpp>	// Pascal unit
#include <Instackconsts.hpp>	// Pascal unit
#include <Inwinsock2.hpp>	// Pascal unit
#include <Instack.hpp>	// Pascal unit
#include <Syncobjs.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Instackwindows
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS EIdIPv6Unavailable;
class PASCALIMPLEMENTATION EIdIPv6Unavailable : public Inexception::EInException 
{
	typedef Inexception::EInException inherited;
	
public:
	#pragma option push -w-inl
	/* EInExceptionBase.Create */ inline __fastcall virtual EIdIPv6Unavailable(AnsiString AMsg)/* overload */ : Inexception::EInException(AMsg) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* Exception.CreateFmt */ inline __fastcall EIdIPv6Unavailable(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size) : Inexception::EInException(Msg, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateRes */ inline __fastcall EIdIPv6Unavailable(int Ident)/* overload */ : Inexception::EInException(Ident) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmt */ inline __fastcall EIdIPv6Unavailable(int Ident, System::TVarRec const * Args, const int Args_Size)/* overload */ : Inexception::EInException(Ident, Args, Args_Size) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateHelp */ inline __fastcall EIdIPv6Unavailable(const AnsiString Msg, int AHelpContext) : Inexception::EInException(Msg, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateFmtHelp */ inline __fastcall EIdIPv6Unavailable(const AnsiString Msg, System::TVarRec const * Args, const int Args_Size, int AHelpContext) : Inexception::EInException(Msg, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResHelp */ inline __fastcall EIdIPv6Unavailable(int Ident, int AHelpContext)/* overload */ : Inexception::EInException(Ident, AHelpContext) { }
	#pragma option pop
	#pragma option push -w-inl
	/* Exception.CreateResFmtHelp */ inline __fastcall EIdIPv6Unavailable(System::PResStringRec ResStringRec, System::TVarRec const * Args, const int Args_Size, int AHelpContext)/* overload */ : Inexception::EInException(ResStringRec, Args, Args_Size, AHelpContext) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~EIdIPv6Unavailable(void) { }
	#pragma option pop
	
};


class DELPHICLASS TIdSocketListWindows;
class PASCALIMPLEMENTATION TIdSocketListWindows : public Instack::TIdSocketList 
{
	typedef Instack::TIdSocketList inherited;
	
protected:
	#pragma pack(push,1)
	Inwinsock2::TFDSet FFDSet;
	#pragma pack(pop)
	/*         class method */ static bool __fastcall FDSelect(TMetaClass* vmt, Inwinsock2::PFDSet AReadSet, Inwinsock2::PFDSet AWriteSet, Inwinsock2::PFDSet AExceptSet, const int ATimeout = 0xfffffffe);
	virtual int __fastcall GetItem(int AIndex);
	
public:
	virtual void __fastcall Add(int AHandle);
	virtual void __fastcall Remove(int AHandle);
	virtual int __fastcall Count(void);
	virtual void __fastcall Clear(void);
	virtual Instack::TIdSocketList* __fastcall Clone(void);
	virtual bool __fastcall Contains(int AHandle);
	void __fastcall GetFDSet(Inwinsock2::TFDSet &VSet);
	void __fastcall SetFDSet(Inwinsock2::TFDSet &VSet);
	#pragma option push -w-inl
	/* virtual class method */ virtual bool __fastcall Select(Instack::TIdSocketList* AReadList, Instack::TIdSocketList* AWriteList, Instack::TIdSocketList* AExceptList, const int ATimeout = 0xfffffffe) { return Select(__classid(TIdSocketListWindows), AReadList, AWriteList, AExceptList, ATimeout); }
	#pragma option pop
	/*         class method */ static bool __fastcall Select(TMetaClass* vmt, Instack::TIdSocketList* AReadList, Instack::TIdSocketList* AWriteList, Instack::TIdSocketList* AExceptList, const int ATimeout = 0xfffffffe);
	virtual bool __fastcall SelectRead(const int ATimeout = 0xfffffffe);
	virtual bool __fastcall SelectReadList(Instack::TIdSocketList* &VSocketList, const int ATimeout = 0xfffffffe);
public:
	#pragma option push -w-inl
	/* TIdSocketList.Create */ inline __fastcall virtual TIdSocketListWindows(void) : Instack::TIdSocketList() { }
	#pragma option pop
	#pragma option push -w-inl
	/* TIdSocketList.Destroy */ inline __fastcall virtual ~TIdSocketListWindows(void) { }
	#pragma option pop
	
};


class DELPHICLASS TInStackWindows;
class PASCALIMPLEMENTATION TInStackWindows : public Instackbsdbase::TInStackBSDBase 
{
	typedef Instackbsdbase::TInStackBSDBase inherited;
	
protected:
	virtual AnsiString __fastcall HostByName(const AnsiString AHostName, const Inglobal::TIdIPVersion AIPVersion = (Inglobal::TIdIPVersion)(0x0));
	virtual void __fastcall PopulateLocalAddresses(void);
	virtual AnsiString __fastcall ReadHostName();
	virtual int __fastcall WSCloseSocket(int ASocket);
	virtual AnsiString __fastcall GetLocalAddress();
	virtual Classes::TStrings* __fastcall GetLocalAddresses(void);
	virtual int __fastcall WSRecv(int ASocket, void *ABuffer, const int ABufferLength, const int AFlags);
	virtual int __fastcall WSSend(int ASocket, const void *ABuffer, const int ABufferLength, const int AFlags);
	virtual int __fastcall WSShutdown(int ASocket, int AHow);
	
public:
	virtual int __fastcall Accept(int ASocket, AnsiString &VIP, int &VPort, const Inglobal::TIdIPVersion AIPVersion = (Inglobal::TIdIPVersion)(0x0));
	virtual Word __fastcall HostToNetwork(Word AValue)/* overload */;
	virtual unsigned __fastcall HostToNetwork(unsigned AValue)/* overload */;
	virtual __int64 __fastcall HostToNetwork(__int64 AValue)/* overload */;
	virtual void __fastcall Listen(int ASocket, int ABackLog);
	virtual Word __fastcall NetworkToHost(Word AValue)/* overload */;
	virtual unsigned __fastcall NetworkToHost(unsigned AValue)/* overload */;
	virtual __int64 __fastcall NetworkToHost(__int64 AValue)/* overload */;
	virtual void __fastcall SetBlocking(int ASocket, const bool ABlocking);
	virtual bool __fastcall WouldBlock(const int AResult);
	virtual AnsiString __fastcall HostByAddress(const AnsiString AAddress, const Inglobal::TIdIPVersion AIPVersion = (Inglobal::TIdIPVersion)(0x0));
	virtual int __fastcall WSGetServByName(const AnsiString AServiceName);
	virtual Classes::TStrings* __fastcall WSGetServByPort(const int APortNumber);
	virtual int __fastcall RecvFrom(const int ASocket, void *VBuffer, const int ALength, const int AFlags, AnsiString &VIP, int &VPort, Inglobal::TIdIPVersion AIPVersion = (Inglobal::TIdIPVersion)(0x0));
	virtual void __fastcall WSSendTo(int ASocket, const void *ABuffer, const int ABufferLength, const int AFlags, const AnsiString AIP, const int APort, Inglobal::TIdIPVersion AIPVersion = (Inglobal::TIdIPVersion)(0x0));
	virtual int __fastcall WSSocket(int AFamily, int AStruct, int AProtocol, const bool AOverlapped = false);
	virtual AnsiString __fastcall WSTranslateSocketErrorMsg(const int AErr);
	virtual int __fastcall WSGetLastError(void);
	virtual void __fastcall WSGetSockOpt(int ASocket, int Alevel, int AOptname, char * AOptval, int &AOptlen);
	virtual void __fastcall Bind(int ASocket, const AnsiString AIP, const int APort, const Inglobal::TIdIPVersion AIPVersion = (Inglobal::TIdIPVersion)(0x0));
	virtual void __fastcall Connect(const int ASocket, const AnsiString AIP, const int APort, const Inglobal::TIdIPVersion AIPVersion = (Inglobal::TIdIPVersion)(0x0));
	__fastcall virtual TInStackWindows(void);
	__fastcall virtual ~TInStackWindows(void);
	virtual void __fastcall Disconnect(int ASocket);
	virtual void __fastcall GetPeerName(int ASocket, AnsiString &VIP, int &VPort);
	virtual void __fastcall GetSocketName(int ASocket, AnsiString &VIP, int &VPort);
	virtual void __fastcall GetSocketOption(int ASocket, int ALevel, int AOptName, /* out */ int &AOptVal);
	virtual void __fastcall SetSocketOption(int ASocket, int ALevel, int AOptName, int AOptVal)/* overload */;
	virtual void __fastcall SetSocketOption(const int ASocket, const int Alevel, const int Aoptname, char * Aoptval, const int Aoptlen)/* overload */;
	virtual bool __fastcall SupportsIPv6(void);
};


struct TLinger
{
	
public:
	Word l_onoff;
	Word l_linger;
} ;

typedef TLinger  TIdLinger;

//-- var, const, procedure ---------------------------------------------------
extern PACKAGE TInStackWindows* GWindowsStack;

}	/* namespace Instackwindows */
using namespace Instackwindows;
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// Instackwindows
