Click to See Complete Forum and Search --> : Creating a Web Server
billrogers
Jan 24th, 2001, 09:28 AM
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
Jop
Jan 24th, 2001, 10:30 AM
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 :D
If someone connects, get the command.
Check what file he wants...
Send the file...
ah **** this isn't working out... :D
I think looking at www.microsoft.com and searching the web would result in some standard commands and stuff.. good luck anyway.
billrogers
Jan 24th, 2001, 01:07 PM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.