#ifndef App_ClientH
#define App_ClientH
//---------------------------------------------------------------------------
#include "IdBaseComponent.hpp"
#include "IdComponent.hpp"
#include "IdTCPClient.hpp"
#include "IdTCPConnection.hpp"

#define MAX_CONNECTION			100

//---------------------------------------------------------------------------
class TClient : public TThread
{
private:
	TIdTCPClient		*Context;

    int					Command, RecvSize;

protected:
	void __fastcall Execute	(void);

public:
	TClient();
	__fastcall virtual ~TClient();

	void	Connect			(String pIP, int pPort);
	void	Disconnect		(void);
	bool 	IsConnect		(void);

	bool	SendPacket		(int pCmd, void *pBuffer, int pSize);

};

//---------------------------------------------------------------------------
extern 	TClient	*clClient[MAX_CONNECTION];

//---------------------------------------------------------------------------
#endif
