// DWBS ------------------------------------------------------------------ DWBS
//
// PLATFORM		: WIN32
// PRODUCT		: BIT_DEMON
// VISIBILITY	: PUBLIC
//
// DWBS ------------------------------------------------------------------ DWBS

#include <bdNet/bdGetHostByName.h>
#include <bdPlatform/bdPlatformSocket/bdPlatformSocket.h>

bdGetHostByName::~bdGetHostByName()
{
	m_thread->join();
	m_thread->cleanup();
	m_thread = BD_NULL;
}

bdUInt bdGetHostByName::run(void* args)
{
	m_numAddresses = bdPlatformSocket::getHostByName((bdNChar8*)args, m_adresses, BD_MAX_NUM_ADDRESSES, m_handle);
	if (m_numAddresses > 0)
	{
		m_status = BD_READY;
	}
	else
	{
		m_status = BD_FAILED;
	}
	return 0;
}
