⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 httpserver.h

📁 一个c++实现的acd的例子。 ----ACDCommandListener.cpp ---ACDCommandListenerThread.cpp ---ACDConfig.cpp ---a
💻 H
字号:
#if !defined(HttpServer_H)
#define HttpServer_H

#include "HttpRequest.h"
#include "HttpServerInfo.h"
#include "ServerSocketHandler.h"
#include "HttpSocketHandler.h"
#include "TextFile.h"
#include "TimeStamp.h"
//#include "../acdx.h"

#include <vector>
using namespace std;


///////////////////////////////////////////////////////////////////////////////////////
// HttpServer
//
// Purpose:		http server implementation

//##ModelId=424BB64400D2
class HttpServer :
	public HttpServerInfo,
	public CreateSocketHandler
{
	//ACDX* acdx;  // static ok
	//##ModelId=424BB64400E4
	HttpRequestList			_requests;		// list of outstanding requests
	//##ModelId=424BB64400F3
	ServerSocket			_serverSocket;
	//##ModelId=424BB6440102
	ServerSocketHandler	*	_handler;

public:
//need  look it [3/29/2005]
	//##ModelId=424BB6440106
	HttpServer( long noConnections = 10, long port = 7001 );
	//##ModelId=424BB6440112
	virtual ~HttpServer();


	// create/release 
	//##ModelId=424BB6440114
	bool	create	( string & server, string & directory );
	//##ModelId=424BB6440123
	void	release	();

/*
		setACDX(ACDX * _acdx)
		{
			acdx = _acdx;
		}*/
	

	// responsible for create a connection
	//##ModelId=424BB6440130
	SocketHandler * createHandler () 
	{
		// create socket handler attach to server info
		// a ref to http server info is passed in
		return (SocketHandler *) new HttpSocketHandler(*this);
	}


	//##ModelId=424BB6440131
	bool	start			();
	//##ModelId=424BB6440140
	void	stop			();

	//##ModelId=424BB6440141
	void    hit				( HttpRequest & request );
	//##ModelId=424BB6440143
	long    run				();

	//##ModelId=424BB644014F
	bool	urlToPath		( string & strFile );
	//##ModelId=424BB6440151
	bool	pathToUrl		( string & strFile );
	//##ModelId=424BB6440160
	bool	checkDefault	( UINT uList, bool bExecute );
	//##ModelId=424BB644016F
	bool	find			( string & strFile );

	//##ModelId=424BB6440171
	bool	isSvrApp		( void );
	//##ModelId=424BB644017F
	bool	checkExt		( const string& strExt, string& strAvail, DWORD dwType );

	//##ModelId=424BB644018F
	string & getServer ()
	{
		return _strServer;
	}

	//##ModelId=424BB6440190
	bool getListIcon ()
	{
		return _bListIcon;
	}

	//##ModelId=424BB6440191
	bool getAllowListing ()
	{
		return _bAllowListing;
	}

};





#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -