Results 1 to 3 of 3

Thread: Creating a Web Server

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    Hi All,

    I have decided to try and create a simple web server in c/c++, can anyone give any good links on where to get some sample code/tutorials/or info on how to go about starting this?

    Thanks
    Bill

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Well, I don't have any links or such (well, someone has created a simple one here (www.analogx.com))

    But the first thing you have to do is...

    Open a port (80) : duhhh
    If someone connects, get the command.
    Check what file he wants...
    Send the file...


    ah **** this isn't working out...

    I think looking at www.microsoft.com and searching the web would result in some standard commands and stuff.. good luck anyway.
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    Well not exactly, first you create a socket, then you set it to receive and bind it to port 80, then you wait for a connection, and when one comes in you fork another socket off to handle that, so your original one is able to continue to listen for more incoming connections. Then the forked socket must go through use the http protocol designated by rfc 1945, and use that to determine what exactly the client want, still using the rfc 1945, and then serve that back to them. Then end the forked socket.

    I'll give your link a look though

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width