Naughter Software Logo

W3Mfc LogoW3Mfc 2.19 A collection of MFC classes to implement a Web Server (Obsolete)

CWSocket v1.48 A set of C++ wrapper class for Sockets,

CThreadPoolServer v1.51 A C++ class framework for Thread pools (Obsolete),

SocServer v1.11 A simple demo server app for CWSocket &

SocClient v1.11 A simple demo client app for CWSocket

Welcome to W3MFC, a collection of MFC classes to implement a simple Web server.

The idea behind is W3MFC was originally to learn about the HTTP protocol and how it is implemented on Win32. It is not intended to be a replacement for IIS or Apache. Instead it is designed as a tool for learning or in cases where deployment of a solution on IIS would be considered overkill.

For detailed information about the Hyper Text Transfer Protocol you should read RFC 1945, You can download this from a number of sites by searching for RFC and 1945.

Another document that these classes refer to is RFC 2045 which defines MIME.

 

The classes which constitute W3Mfc are:

CW3MFCServerSettings: This class contains the settings which are used to configure the web server. Example member variables in this class include the virtual directories and the their default filenames. If you are developing a stand alone web server based on W3Mfc, you could for example store all the variables for the CW3MFCServerSettings instance in an ini file or in the registry.

 

CW3MFCServer: This is the actual class which implements the web server. It has a number of very simple functions to allow you to control the state of the web server such as Start and Stop. Internally a background thread is spun off to handle the client connections.

 

CWSocket: This is a simple C++/MFC encapsulation of an SDK socket. A class called CW3MFCSocket is derived for this in the W3MFC web server to provide custom HTTP parsing. The CWSocket class can be using in other projects to provide a simple encapsulation of a socket.

 

CW3MFCResponseHeader: This class helps in the handling of sending request headers when returning the HTTP responses to clients. It provides a number of methods to allow standard Http headers to be added to the client response.

 

CW3MFCMimeManager: This class is used when returning client responses. It is used to determine to mime type of a file given its extension type. This information is taken from the registry and is cached in this class. For example files of .htm or .html will normally be of mime type "text/html".

 

CW3MFCRequest: This class represents a request from a client. It contains information such as the URI of the request, the Http Verb used and the Http version used for the request. A member of this type is stored in the CW3MFCClient class.

 

CW3MFCClient: This class is used in the CW3MFCServer class to handle client connections. It handles the parsing of client requests and returning the appropriate response. A number of virtual functions are provided to allow end user customisation.

 

CW3MFCDirectory: This class is used by the CW3MFCClient class to allow per directory customisation of client connections. A number of virtual functions are provided to allow end user customisation.

 

CThreadPoolServer: This class provides the thread pool functionality. To use it in your code, just derive a class from CThreadPoolClient (as is done for the W3MFC web server) and implement your own specific code in CThreadPoolClient::Run. The CThreadPoolServer class can be used in other projects to provide a simple encapsulation of a thread pool.

 

The enclosed zip file contains the W3Mfc source code and a simple console based application which implements a simple web server.

 

Two additional downloads are provided as samples for the CWSocket class. socserver.zip implements a simple single threaded time (RFC 868) sockets server and socclient.zip implements a client for the same. Please note that if you want to compile these examples, then you should copy the SocMFC.cpp/h files from the main W3MFC zip file into the directory where you have downloaded the socclient and socserver samples.

 

Copyright

 

Updates

v1.11 of SocClient (28 May 2022)

v1.11 of SocServer (28 May 2022)

v1.10 of SocClient (6 December 2020)

v1.10 of SocServer (6 December 2020)

8 November 2020

v1.48 of CWSocket (8 November 2020)

v2.19 of W3MFC / v1.47 of CWSocket (21 July 2020)

v2.18 of W3MFC / v1.46 of CWSocket / v1.51 of CThreadPoolServer (14 June 2020)

v2.17 of W3MFC / v1.45 of CWSocket / v1.50 of CThreadPoolServer/ v1.09 of SocClient / v1.09 SocServer (31 December 2019)

v2.16 of W3MFC / v1.44 of CWSocket (28 September 2019)

v1.08 of SocClient (28 September 2019)

v1.08 of SocServer (28 September 2019)

v2.15 of W3MFC (12 September 2019)

v2.14 of W3MFC / v1.43 of CWSocket / v1.49 of CThreadPoolServer (29 July 2019)

v2.13 of W3MFC (29 May 2019)

v2.12 of W3MFC / v1.43 of CWSocket / v1.48 of CThreadPoolServer (13 April 2019)

v1.07 of SocClient and SocServer (1 January 2019)

v2.11 of W3MFC / v1.42 of CWSocket (4 December 2018)

v2.10 of W3MFC / v1.41 of CWSocket / v1.47 of CThreadPoolServer (21 August 2018)

v2.09 of W3MFC / v1.40 of CWSocket / v1.46 of CThreadPoolServer (20 June 2018)

v2.08 of W3MFC / v1.39 of CWSocket / v1.45 of CThreadPoolServer (10 December 2017)

v2.07 of W3MFC / v1.06 of SocClient and SocServer (13 August 2017)

v2.06 of W3MFC (30 June 2017)

v2.05 of W3MFC / v1.38 of CWSocket / v1.43 of CThreadPoolServer (28 April 2017)

v2.04 of W3MFC / v1.42 of CThreadPoolServer (17 April 2017)

v2.03 of W3MFC / v1.41 of CThreadPoolServer (22 November 2016)

v2.02 of W3MFC (17 August 2016)

v1.40 of CThreadPoolServer (11 August 2016)

v2.01 of W3MFC (24 July 2016)

v1.05 of SocClient and v1.05 of SocServer (24 July 2016)

v2.0 of W3MFC / v1.37 of CWSocket / v1.39 of CThreadPoolServer (17 July 2016)

27 November 2015

v1.99 of W3MFC / v1.36 of CWSocket (28 October 2015)

v1.38 of CThreadPoolServer (4 January 2015)

v1.98 of W3MFC / v1.35 of CWSocket (26 November 2014)

13 April 2014

v1.97 of W3MFC / v1.37 of CThreadPoolServer (29 March 2014)

v1.96 of W3MFC / v1.34 of CWSocket / v1.36 of CThreadPoolServer (16 March 2014)

v1.95 of W3MFC / v1.33 of CWSocket / v1.35 of CThreadPoolServer (12 August 2012)

v1.32 of CWSocket / CSSLSocket (3 April 2011)

v1.31 of CWSocket / CSSLSocket (8 February 2011)

v1.94 of W3MFC / v1.30 of CWSocket / v1.34 of CThreadPoolServer / v1.04 of SocClient and SocServer (9 January 2011)

v1.93 of W3MFC

v1.92 of W3MFC / v1.29 of CWSocket (12 July 2009)

v1.91 of W3MFC / v1.28 of CWSocket/CSSLSocket / v1.33 of CThreadPoolServer / v1.03 of SocClient and SocServer (24 May 2009)

v1.90 of W3MFC / v1.02 of SocClient and SocServer (8 June 2008)

v1.89 of W3MFC / v1.27 of CWSocket / v1.32 of CThreadPoolServer (31 May 2008)

v1.31 of CThreadPoolServer

v1.88 of W3MFC / v1.26 of CWSocket (1 March 2008)

v1.87 of W3MFC / v1.30 of CThreadPoolServer / v1.25 of CWSocket (19 February 2008)

v1.86 of W3MFC / v1.24 of CWSocket (2 February 2008)

v1.85 of W3MFC / v1.23 of CWSocket (31 December 2007)

v1.22 of CWSocket (27 December 2007)

v1.84 of W3MFC / v1.21 of CWSocket (26 December 2007)

v1.83 of W3MFC / v1.29 of CThreadPoolServer / v1.02 of CW32Handle / v1.20 of CWSocket (20 November 2007)

v1.82 of W3MFC (9 May 2007)

v1.01 of SocClient and SocServer (27 January 2007)

v1.81 of W3MFC (12 January 2007)

v1.80 of W3MFC (21 September 2006)

v1.28 of CThreadPoolServer (8 August 2006)

v1.27 of CThreadPoolServer (6 August 2006)

v1.79 of W3MFC / v1.19 of CWSocket / v1.26 of CThreadPoolServer (27 June 2006)

v1.78 of W3MFC / v1.25 of CThreadPoolServer (31 May 2006)

v1.24 of CThreadPoolServer (13 April 2006)

v1.77 of W3MFC / v1.18 of CWSocket (19 February 2006)

v1.76 of W3MFC (8 February 2006)

v1.75 of W3MFC (3 January 2006)

v1.17 of CWSocket (27 November 2005)

v1.16 of CWSocket (16 November 2005)

v1.74 of W3MFC / v1.15 of CWSocket (4 November 2005)

v1.73 of W3MFC (30 October 2005)

v1.23 of CThreadPoolServer (11 September 2005)

v1.14 of CWSocket / CSSLSocket (21 June 2005)

v1.13 of CWSocket / CSSLSocket (1 May 2005)

v1.72 of W3MFC / v1.11 of CWSocket (19 February 2005)

v1.11 of CWSocket / CSSLSocket (31 January 2005)

v1.10 of CWSocket / CSSLSocket (29 December 2004)

v1.22 of CThreadPoolServer (4 December 2004)

v1.21 of CThreadPoolServer / v1.71 of W3MFC / v1.09 of CWSocket / v1.01 of CW32Handle (11 November 2004)

v1.70 of W3MFC (15 October 2004)

6 September 2004

v1.69 of W3MFC (26 August 2004)

v1.0 of SocClient and SocServer (20 August 2004)

v1.68 of W3MFC (30 March 2004)

v1.67 of W3MFC (22 February 2004)

v1.66 of W3MFC / v1.20 of CThreadPoolServer / v1.08 of CWSocket (13 January 2004)

v1.65 of W3MFC

v1.64 of W3MFC / v1.07 of CWSocket (3 November 2003)

v1.06 of CWSocket / CSSLSocket (5 October 2003)

v1.05 of CWSocket (26 September 2003)

v1.04 of CWSocket (21 September 2003)

v1.63 of W3MFC (12 September 2003)

6 April 2003

v1.03 of CWSocket (3 March 2003)

v1.19 of CThreadPoolServer (3 March 2003)

v1.62 of W3MFC (3 March 2003)

v1.61 of W3MFC (2 March 2003)

v1.60 of W3MFC (27 February 2003)

v1.56 of W3MFC (21 February 2003)

v1.55 of W3MFC (3 February 2003)

25 November 2002

v1.54 of W3MFC (20 November 2002)

v1.52 of W3MFC (18 November 2002)

v1.53 of W3MFC (18 November 2002)

v1.51 of W3MFC (17 November 2002)

v1.50 of W3MFC (17 November 2002)

v1.18 of CThreadPoolServer (10 November 2002)

v1.17 of CThreadPoolServer (7 November 2002)

v1.16 of CThreadPoolServer (17 October 2002)

v1.15 of CThreadPoolServer (17 October 2002)

v1.49 of W3MFC (17 October 2002)

v1.14 of CThreadPoolServer (14 October 2002)

v1.13 of CThreadPoolServer (12 October 2002)

v1.12 of CThreadPoolServer (8 October 2002)

v1.11 of CThreadPoolServer (4 October 2002)

v1.10 of CThreadPoolServer (20 August 2002)

v1.09 of CThreadPoolServer (18 August 2002)

v1.48 of W3MFC (18 August 2002)

v1.47 of W3MFC (28 July 2002)

v1.46 of W3MFC (14 June 2002)

4 June 2002

v1.45 of W3MFC (30 May 2002)

v1.44 of W3MFC (29 May 2002)

v1.43 of W3MFC (25 May 2002)

v1.42 of W3MFC (24 May 2002)

v1.41 of W3MFC (23 May 2002)

v1.08 of CThreadPoolServer / v1.40 of W3MFC (29 April 2002)

v1.07 of CThreadPoolServer / v1.39 of W3MFC (29 April 2002)

v1.06 of CThreadPoolServer / v1.38 of W3MFC (17 April 2002)

31 March 2002

v1.37 of W3MFC (23 March 2002)

v1.36 of W3MFC (21 February 2002)

v1.01 of CIOCP9x / v1.35 of W3MFC (26 January 2002)

v1.34 of W3MFC / v1.0 of CW32Handle (8 January 2002)

v1.33 of W3MFC / v1.02 of CWSocket / v1.05 of CThreadPoolServer (27 December 2001)

v1.32 of W3MFC (3 November 2001)

v1.01 of CWSocket / v1.31 of W3MFC (30 September 2001)

v1.04 of CThreadPoolServer / v1.3 of W3MFC (26 August 2001)

v1.03 of CThreadPoolServer / v1.23 of W3MFC (7 August 2001)

v1.02 of CThreadPoolServer / v1.22 of W3MFC (25 July 2001)

v1.01 of CThreadPoolServer (21 July 2001)

v1.21 (23 April 2001)

v1.2 (15 April 2001)

v1.11 (29 February 2000)

v1.1 (29 June 1999)

v1.0 (4 May 1999)