MFC,IIS,RFC,MIME,CMFC,SDK,HTTP,URI,3Mfc,colle
Quick Search for:  in language:    
MFC,IIS,RFC,MIME,CMFC,SDK,HTTP,URI,3Mfc,colle
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
C/ C++ Stats

 Code: 451,578 lines
 Jobs: 605 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for C/ C++.
Visual Pi Hex
By jo122321323 on 8/25


Click here to see a screenshot of this code!ShortCutSample
By Massimiliano Tomassetti on 8/25

(Screen Shot)

AnPMoneyManager beta
By Anthony Tristan on 8/24


A calculator (english/polish )
By Tom Dziedzic on 8/24


MMC (Mouse Move Counter)
By Laszlo Hegedüs on 8/24


Text-DB
By Jerome A. Simon on 8/24


JDos
By Jerome A. Simon on 8/23


Game 1945X
By Ozgun Harmanci on 8/23


Find hidden "back streamed" files on NTFS partitions. This code is a must for sec consultants.
By Israel B. Bentch on 8/22


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

MFC classes to implement a Web Server

Print
Email
 
winzip icon
Submitted on: 10/27/1999
By: PJ Naughter  
Level: Intermediate
User Rating: By 104 Users
Compatibility:C++ (general)

Users have accessed this code 6847 times.
 
 
     3Mfc 1.1 A collection of freeware MFC classes to implement a Web Server Welcome to W3Mfc, a collection of freeware 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 or your product must run on 95/98 in addition to NT. 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 on www.yahoo.com. Another document that these classes refer to is RFC 2045 which defines MIME. The classes which constitute W3Mfc are: CHttpServerSettings: This class contains the settings which are used to configure the web server. Example member variables in this class include the root directory and the default filename. If you are developing a stand alone web server based on W3Mfc, you could for example store all the variables for the CHttpServerSettings instance in an ini file or in the registry. In the future this is the class which will be extended to include additional settings such as multiple virtual directories. CHttpServer: 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. CHttpSocket: This is a simple C++/MFC encapsulation of an SDK socket. CHttpResponseHeader: 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. CHttpMimeManager: This class is used when returning client responses. It is used to determine the 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". CHttpRequest: 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 CHttpClient class. CHttpClient: This class is used in the CHttpServer 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 customization. The enclosed zip file contains the W3Mfc source code and a simple console based application which implements a simple web server. PJ Naughter at http://indigo.ie/~pjn/index.html
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzipto decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 44 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
10/3/2001 1:13:42 PM:Ken Weinert
This code is mis-classified under 
general C++ when it is windows specific
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | C/ C++ Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.