Hi ,
Is it possible to have a servlet listen to a specified port?. Any
examples of how to do this (or links to examples) would be great.
I have not had much success having this question answered, or finding
examples when searching via Google.
Thanks
kaeli - 27 May 2005 17:36 GMT
> Hi ,
>
> Is it possible to have a servlet listen to a specified port?.
In general, servlets don't listen to a port. The web server listens, then
passes off the request to the servlet container.
You can set up a web server to run on any port you like. You may even be able
to set up the servlet container separately if you use Tomcat or the like.
As to just setting the servlet to do it all by itself, I don't think you can.
It needs the servlet container to do its job. So at the minimum, the servlet
container would be listening to the specified port.
Perhaps a web service would be more appropriate for your task?

Signature
--
~kaeli~
"No matter what happens, somebody will find a way to take
it too seriously."
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
Bryce - 27 May 2005 17:52 GMT
>Hi ,
>
>Is it possible to have a servlet listen to a specified port?. Any
>examples of how to do this (or links to examples) would be great.
Sure. But first tell us what servlet engine you are using.
For tomcat, try here:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html
look for the attribute "port"
>I have not had much success having this question answered, or finding
>examples when searching via Google.
--
now with more cowbell