hello there, i just want to ask...how would i apply threading to a web server app?? my problem is, i dunno how to create a web server...i created a simple server that sends hello world to a client that sends a request...how would i apply threading to this one??

Recommended Answers

All 9 Replies

normally, you would not try to write a web server yourself. instead you would host your web application inside an application server like apache or IIS. and let that take care of not merely threading, but also a lot of other issues which need to be addressed (security, cookie management, crah recovery, process or thread pooling etc.)

so, you write/create/program the host, not the server? so what i did is not a server, but a host that sends hello world string to it's requesting client?

what's the difference between a host and a server?

oh...i see...thanks dude...what i made was not a web server but a socket server...uhmmm...could i create a web server out of this socket server?

could i create a web server out of this socket server?

start by creating a server (handling http requests) which will handle only one request at a time. once that is working well, you can try scaling it up to handle many requests. here is a link you might find helpful:
http://www.codeproject.com/useritems/generic_pipeline_cpp.asp

thank you dude, i'll read this one...i might have some questions, is it ok to ask? i might need your help... :)

normally, you would not try to write a web server yourself.

Someone has to do it ;)
Been thinking of writing my own IRC server but things keep getting in the way.

hehe, why am i reinventing the wheel?? *chuckles*

hiii, sorry i av a big probleem :( im creating a web server in c++ running on a POSIX system, and it has to deal with GET and HEAD requests. The GET returns all appropriate HTTP response lines and then sends the file, and HEAD is the same BUT doesnt send the file :( totally clue less on what kinds of codes i have to use. c++ is sooo hard :(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.