Click here to Skip to main content
12,998,483 members (129,579 online)
Click here to Skip to main content

Stats

77K views
2.3K downloads
47 bookmarked
Posted 8 May 2000

STL WebServer

, 8 May 2000
A set of classes written in STL that implement a web server
#if !defined(HttpServerStats_H)
#define HttpServerStats_H

#include "TextFile.h"
#include "HttpRequest.h"

#include <vector>
using namespace std;

#pragma warning( disable:4800 )


// types of status counters
enum 
{ 
	STATUS_INFORMATIONAL = 0,
	STATUS_SUCCESS, 
	STATUS_REDIRECTION,
	STATUS_CLIENTERR, 
	STATUS_SERVERERR,
	STATUS_NO_COUNTERS
};

///////////////////////////////////////////////////////////////////////////////////////
// HttpServerStats
//
// Purpose:		http server statistics



class HttpServerStats
{
protected:

	bool			_logging;			// shows if logging results
	vector<long>	_stats;				// stats for server by status group
	int				_numberOfHits;		// total hits
	TextFile		_logFile;			// log file for server stats

public:

	HttpServerStats ();
	virtual ~HttpServerStats ();

	// create release
	bool create  ();
	void release ();

	// status methods
	void    reset			();
	void    hit				( HttpRequest & request );
	void    getStats		( HttpRequest & request );

	// logging methods
	bool getLogging ()
	{
		return _logging;
	}

	void setLogging ( bool set )
	{
		_logging = set;
	}


};


#endif

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

David Hubbard
United States United States
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170622.1 | Last Updated 9 May 2000
Article Copyright 2000 by David Hubbard
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid