On 13/05/2013 16:34, Chirag Dewan wrote:
> Hi,
> 
> I am embedding  Apache Tomcat 7.0.30 in my application. I am using the Tomcat 
> class,and my application requires dynamic addition and removal of 
> connectors(HTTP).
> 
> Now while removing the connectors,the application gets undeployed but the 
> port remains occupied and the connector continue to listen on the port. I am 
> using customized HTTP connector.
> 
> 
>   Here is a snippet from my source code:
> 
> for removing connector:
> 
> if( connector != null )
>         {
>             connector.decUsage();
>             if( connector.getUsage() == 0 )
>             {
>                 connector.stop();
>                 this.tomcat.getService().removeConnector( connector );
>             }
>         }
> 
> for adding connector:
> 
> this.tomcat.getService().addConnector( connector );
> 
> 
> I know the port is not getting free. Because when I try to deploy to the same 
> port again,it gives me an address already in use exception.
> I have surfed for this issue a lot,but to no avail. Any help would be greatly 
> appreciated.

You need to destroy the connector to close the port.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to