I have a copy of Tomcat embedded inside my application, and it runs great. During the processing, I'd like to open another port to service requests on. The documentation on the Embedded object states:
"After normal operations have begun, you can add and remove Connectors, Engines, Hosts, and Contexts on the fly."
Great, that's exactly what I want to do. However, I'm finding that if I try to add a new Connector to my Embedded object, I still can't connect on that port. Here's my code:
CoyoteConnector connector = (CoyoteConnector)embedded.createConnector((InetAddress)null, newPort, false);
// not sure why/if these are necessary
// I don't call these when I set up the initial port to listen on
connector.initialize();
connector.start();
embedded.addConnector(connector);
I after running this code I call embedded.findConnectors(), my new connector shows up in the isAvailable state. However, I can't connect on the new port.
Any ideas on what could be going wrong? I'm running Tomcat 5.0.28.
Sander Smith