Re: making an http server



Probably some hints here:
http://www.asp.net/Projects/Cassini/Download/Default.aspx?tabindex=0&tabid=1

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***********************************************
Think Outside the Box!
***********************************************
"lucifer" <umeshktangnu@xxxxxxxxx> wrote in message
news:1133369609.498812.314330@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> hi
> i am making an http server
> it has following functions
> main()
> {
> if option is "-?", output the hints and stop
> check the directory supplied is sensible and not a security risk
> become a daemon process
> ignore child programs (to avoid zombies when child processes stop)
>
> create a socket, bind it to a port number and start listening to the
> socket
>
> forever {
> wait and accept incoming socket connection
> start a new thread
> web function
> else close new connection
> }
> }
>
> log()
> {
> outputs error, sorry or log messages to the nweb.log file
> if a sorry message, transmit it to the browser as a fake HTML response
> if error or sorry message the program is stopped
> }
>
> web() - this function returns the request back to the browser
> {
> read from the socket the HTTP request
> check it's a simple GET command
> check no parent directory requested to escape the web servers home
> directory
> if no file name given assume index.html
> check the file extension is valid and supported
> check the file is readable by opening it
> transmit the HTTP header to the browser
> transmit the file contents to the browser
> sleep thread for 1 second
> stop
> }
> mine problem is how can i start a new thread for every new request i
> recieve
> plz help
>


.



Relevant Pages

  • Re: How to write something to a html textfield and send it?
    ... > No need for controlling any particular browser. ... I'm not familiar with HTTP user ... and building the request in your program. ... The server doesn't know anything about a textfield; ...
    (comp.programming)
  • Re: Generated javascript from .pl files
    ... Because web servers might use a different HTTP specification than ... the visiting browser, so possible HTTP version conflicts arise. ... I'd like to see an otherwise usable Web client that does not support ... one that is used here does not rely on the (Content-* request) HTTP headers. ...
    (comp.lang.javascript)
  • Re: Http 401 Unauthorised
    ... Iain Adams wrote: ... A SoapException occurred: Message: The request failed with HTTP status ... If this is the first 401 this site has sent while the browser has been running, it will pop up the userid/password box on your screen. ...
    (comp.lang.php)
  • Re: How to write something to a html textfield and send it?
    ... No need for controlling any particular browser. ... I'm not familiar with HTTP user ... >> used easily to detect the html tags and the required textfield. ... or do you just need to submit the request with the appropriate ...
    (comp.programming)
  • Re: writing a proxy ..
    ... I redirect my browser to the local server and re-route the HTTP ... Socket orig; ...
    (comp.lang.java.programmer)