///////////////////////////////////////////////////////////////////////////////
/// @file deTCPConnectionProvider.hpp
///
/// @brief 
///
/// @author trajar
///
/// This file is the intellectual property of Novus Delta, LLC.. Usage of the
/// contents of this file is subject to the Destiny3D Member License which
/// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
///
/// This file is distributed "AS IS" without warranty of any kind.  Novus
/// Delta, LLC. does not guarantee the fitness of the contents of this file
/// for any particular purpose.
///
/// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
///
/// <hr>
///                                 Change History
/// <hr>
///
/// @date Jun 2002
/// @author trajar
/// @remarks Creation
///
///////////////////////////////////////////////////////////////////////////////

#ifndef	_DETCPCONNECTIONPROVIDER_HPP
#define _DETCPCONNECTIONPROVIDER_HPP

#include	<WINSOCK2.H>

#ifndef		_DECONNECTIONPROVIDER_HPP
 #include	"deConnectionProvider.hpp"
#endif

typedef class DENET_API deTCPConnectionProvider : public deConnectionProvider
{
public:

	deTCPConnectionProvider(void);
	virtual ~deTCPConnectionProvider(void);

	struct ProviderInfo
	{
		DWORD				dwVersion;
		WSADATA				wsDeviceData;
		WSAPROTOCOL_INFO *	wsProtocolInfo; // we will hold a dozend protocols
		int					iNumProtocols;
	};

	virtual deConnection *			 GetConnectionAt( DWORD pIndex );
	static deTCPConnectionProvider * GetMgr(void)	{ return m_Singleton; }

protected:

	virtual deConnectionBin *	GetAvailableBin(void);
	virtual deConnection *		GetUnusedConnection(void);

	virtual eNetError	OnInit( DWORD dwFlags = NULL );
	virtual eNetError	OnShutdown( DWORD dwFlags = NULL );
	virtual	eNetError	OnCreateConnection( deConnection ** pOut, void * pProviderInfo = NULL, DWORD dwFlags = NULL );
	virtual eNetError	OnCloseConnection( deConnection ** pConn, DWORD dwFlags = NULL );

private:

	ProviderInfo		m_ProviderInfo;
		
	static deTCPConnectionProvider * m_Singleton;

} deTCPConnectionProvider, *pdeTCPConnectionProvider;


#endif