// SocketClient.cpp: implementation of the ExCSocketClient class.
//
//////////////////////////////////////////////////////////////////////

#include "ExCSocketClient.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

ExCSocketClient::ExCSocketClient(){Guard(ExCSocketClient::ExCSocketClient())
	ExCSocket();
UnGuard
}

ExCSocketClient::ExCSocketClient(int domaine,int protocole){Guard(ExCSocketClient::ExCSocketClient())
	ExCSocket(domaine,protocole);
UnGuard
}

ExCSocketClient::~ExCSocketClient(){Guard(ExCSocketClient::~ExCSocketClient())

UnGuard
}

int ExCSocketClient::Connect(struct sockaddr_in Adresse)
{
Guard(ExCSocketClient::Connect(struct sockaddr_in Adresse))
	int ret=0;
	unsigned int tailleSockaddr_in;
	tailleSockaddr_in=sizeof(struct sockaddr_in);
	if((ret==connect(m_hSocket,(struct sockaddr *)&Adresse,tailleSockaddr_in))==-1)
	{
		Trace(Erreur sur connect de la socket);
		Close();
	}
	return ret;
UnGuard
}

int ExCSocketClient::Connect(void)
{
Guard(ExCSocketClient::Connect())
	unsigned int tailleSockaddr_in;
	tailleSockaddr_in=sizeof(struct sockaddr_in);
	return connect(m_hSocket,(struct sockaddr *)&m_AdresseSocket,tailleSockaddr_in);
UnGuard
}

int ExCSocketClient::Connect(std::string server)
{
Guard(ExCSocketClient::Connect(std::string server))
//find if this is a name or an ip

	return 0;
UnGuard
}

void ExCSocketClient::SetSocketAdresse(sockaddr_in Adresse){Guard(ExCSocketClient::SetSocketAdresse(sockaddr_in Adresse))
	m_AdresseSocket=Adresse;
UnGuard
}

struct sockaddr_in ExCSocketClient::GetSocketAdresse(void){Guard(ExCSocketClient::GetSocketAdresse(void))
	return m_AdresseSocket;
UnGuard
}

void ExCSocketClient::Init(void)
{
Guard(void ExCSocketClient::Init(void))
	ExCSocket::Init();
UnGuard
}

void ExCSocketClient::Init(char *NAME)
{
Guard(void ExCSocketClient::Init(void))
	ExCSocket::Init();
UnGuard
}















