This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to start a server?

 
Jim Smithian
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am developing a web application using Java Servlets. The Servlets are supposed to send some messages over ssl to a server that I have developed, let's call it myServer. myserver listens to ssl sockets in an infinite loop. myServer should start at the same time as my web application starts.

My question is that how can I start myServer?. I am thinking of three ways to start myServer:

1- manually start myServer from command line

2- from the init() method of one my Servlets. Then I need to create a thread just to run myServer.

3- have a separate Servlets just to start myServer.

None of the above solutions seems good to me. Does any body has a better idea?

Thanks.

Jim
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13047
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from the init() method of one my Servlets. Then I need to create a thread just to run myServer.

Not really, just exec a batch file (after checking to see if the service is already running) to start a separate JVM with your service.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic