Click here to Skip to main content
Licence 
First Posted 8 May 2000
Views 65,396
Bookmarked 42 times

STL WebServer

By | 8 May 2000 | Article
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 dghubbard@megsinet.com.

    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

    About the Author

    David Hubbard



    United States United States

    Member



    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board. (secure sign-in)
     
    Search this forum  
     FAQ
        Noise  Layout  Per page   
      Refresh
    GeneralBUG REPORT: when input http://127.0.0.1/something.rar , IE dose NOT download the file but just show the rar file's content in IE itself Pinmemberadroitadroit2016:17 3 Dec '06  
    GeneralRe: BUG REPORT: when input http://127.0.0.1/something.rar , IE dose NOT download the file but just show the rar file's content in IE itself Pinmembernickhalfasleep3:22 31 May '07  
    GeneralStream to output port PinmemberRobert Bielik21:12 11 Apr '06  
    GeneralWhen user often click it is very busy Pinmembergiga217:11 4 Apr '05  
    Generalsome bug fixes PinmemberMark Timperley6:11 22 Jan '02  
    GeneralRe: some bug fixes PinmemberJames Curran11:32 29 May '02  
    GeneralRe: some bug fixes Pinmemberrfmobile23:30 10 Oct '03  
    GeneralRe: some bug fixes PinmemberJames Curran3:50 11 Oct '03  
    Questiona Suggestion ?? PinmemberPaul_Fallon@yahoo.no.spam.please.com20:25 27 Jan '01  
    AnswerRe: a Suggestion ?? PinmemberJames Curran11:13 29 May '02  

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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 | Mobile
    Web03 | 2.5.120517.1 | Last Updated 9 May 2000
    Article Copyright 2000 by David Hubbard
    Everything else Copyright © CodeProject, 1999-2012
    Terms of Use
    Layout: fixed | fluid