Click here to Skip to main content
13,598,498 members
Click here to Skip to main content
Add your own
alternative version


46 bookmarked
Posted 8 May 2000

STL WebServer

, 8 May 2000
Rate this:
Please Sign up or sign in to vote.
A set of classes written in STL that implement a web server
  • Download source files - 76 Kb
  • Introduction

    This article presents code for a web server implemented using sockets and STL. The code for the web server was adapted from the httpsvr sample in MSDN. The visual interface has been removed. All of the the MFC code has been ripped out and converted to STL, and socket classes were implemented.

    The socket classes are:

    • Socket
    • ServerSocket

    These feed handler classes:

    • SocketHandler
    • ServerSocketHandler
    • HttpSocketHander

    Socket notification comes from the abstract class SocketNotify which SocketHandler implements. A reference can be passed in to override the notification.

    The http request classes are:

    • HttpBuffer
    • HttpRequest
    • HttpRquestProcess
    • HttpResponse

    The request class allows you to create requests or to store a request. The request process processes requests by passing in a pointer to a buffer. The request process class gets initial info like the URL and then forms a response.

    The startup code is in Server.cpp which declares an instance of HttpServer. To set up the code to run set the directory where your web pages are and then compile and run.

    I would like to here any comments on how to improve performance or how to better implement the web server. So if you get time email me at


    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


    About the Author

    David Hubbard
    United States United States
    No Biography provided

    You may also be interested in...

    Comments and Discussions

    GeneralBUG REPORT: when input , IE dose NOT download the file but just show the rar file's content in IE itself Pin
    adroitadroit203-Dec-06 16:17
    memberadroitadroit203-Dec-06 16:17 
    GeneralRe: BUG REPORT: when input , IE dose NOT download the file but just show the rar file's content in IE itself Pin
    nickhalfasleep31-May-07 3:22
    membernickhalfasleep31-May-07 3:22 
    GeneralStream to output port Pin
    Robert Bielik11-Apr-06 21:12
    memberRobert Bielik11-Apr-06 21:12 
    GeneralWhen user often click it is very busy Pin
    giga24-Apr-05 17:11
    membergiga24-Apr-05 17:11 
    Generalsome bug fixes Pin
    Mark Timperley22-Jan-02 6:11
    memberMark Timperley22-Jan-02 6:11 
    GeneralRe: some bug fixes Pin
    James Curran29-May-02 11:32
    memberJames Curran29-May-02 11:32 
    GeneralRe: some bug fixes Pin
    rfmobile10-Oct-03 23:30
    memberrfmobile10-Oct-03 23:30 
    GeneralRe: some bug fixes Pin
    James Curran11-Oct-03 3:50
    memberJames Curran11-Oct-03 3:50 
    Namespace usage that simple has worked in VC since version 5 (1996). By 2000 (the date of the article), only very complex naespaces usage failed.

    Questiona Suggestion ?? Pin 20:25 20:25 
    AnswerRe: a Suggestion ?? Pin
    James Curran29-May-02 11:13
    memberJames Curran29-May-02 11:13 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
    Web01-2016 | 2.8.180621.3 | Last Updated 9 May 2000
    Article Copyright 2000 by David Hubbard
    Everything else Copyright © CodeProject, 1999-2018
    Layout: fixed | fluid