Is it possible to have a Java application listen to HTTP requests via servlets and to listen to other TCP port at the same time? Is there a standard way to do this?
1 Answer
One way to achieve this, is to embed Jetty into your main application. Here is a tutorial.
With the embedded Jetty servlet container you can run standard Java web applications (WARs). At the same time in your main application you can listen to other TCP ports via a ServerSocket.