Click here to Skip to main content
15,885,914 members
Articles / Programming Languages / C++

Power of C++ - Developing a Portable HTTP Server with Python Interpreter using Boost, TinyXML

Rate me:
Please Sign up or sign in to vote.
4.83/5 (14 votes)
1 Jun 2008CPOL6 min read 61.5K   1.5K   63  
This article describes portable networking library (ahttp) and small HTTP server - result of modern C++ programming approaches investigation
#ifndef AHTTP_SERVER_CONSTANTS_H
#define AHTTP_SERVER_CONSTANTS_H

#include "aconnect/types.hpp"

namespace ReturnCodes
{
	const int Success = 0;
	const int InitizalizationFailed = 1;
	const int SettingsLoadFailed = 2;
	const int LoggerSetupFailed = 3;
	const int ServerStartupFailed = 4;
	const int ForceStopped = 10;
}

namespace Settings
{
	const aconnect::string_constant ConfigFileName = "server.config";

	const aconnect::string_constant CommandsList = 
		"ahttpserver commands: \r\n"
		"- to start server run \"ahttpserver start\"\r\n"
		"- to stop server run \"ahttpserver stop\"\r\n"
		"- to get statistics run \"ahttpserver stat\"\r\n";
	const aconnect::string_constant StatisticsFormat = 
		"ahttpserver statistics\r\nprocessed requests count: %d\r\n"
		"worker threads count: %d\r\n"
		"pending threads count: %d\r\n";

	const aconnect::string_constant CommandStat = "stat";
	const aconnect::string_constant CommandStart = "start";
	const aconnect::string_constant CommandRun = "run";
	const aconnect::string_constant CommandStop = "stop";
	const aconnect::string_constant CommandReload = "reload";
	const aconnect::string_constant CommandUnknown = "unknown";
	
	const aconnect::string_constant BreakLine = "----------------------------------------------------------------";
	const aconnect::string_constant EndMark = "\r\n\r\n";

}



#endif // AHTTP_SERVER_CONSTANTS_H

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Belarus Belarus
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions