To create a Http Server..?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, March 27, 2001 02:03 AM

I want to know, how we go about writing an http server of
our own using Java.
I have created a ServerSocket which will listen for clients,
so whenever a client conects (through IExplorer or Netscape)
I should display the response according to the request.
I'm able to display the text things, but images are not
coming properly and the speed is also very slow.
Please help me in doing it up. Thanking you in advance

Re: To create a Http Server..?

Posted By:   Tim_Rohaly  
Posted On:   Saturday, April 21, 2001 10:00 AM

Why would you ever want to to this yourself?
Java source code is available for a plethora
of public-domain HTTP servers, ranging from the
simple (e.g. http://www.acme.com/software/micro_httpd/)
to the industrial-strength (e.g. http://www.w3.org/Jigsaw


If you really want to start from scratch, get a copy of the
HTTP specification and read it - that is the only way you
will be able to create a compliant server. The fact that you
are not serving images properly means you are probably
not treating the data as binary, or are responding with the
wrong MIME type in the header. Since you complain about
speed, I'm guessing you're not buffering or using multiple
threads properly. Writing a high-performance, high-volume
server in any language is not a trivial task.

About | Sitemap | Contact