tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Butter <>
Subject binding to a specific ip doesn't work as exspected
Date Tue, 02 Jan 2001 23:36:00 GMT
Binding tomcat to a IP that is not an IP of the hostname fails, because 
it is checked in

I don't think that this makes any sense. In a virtual host enviroment 
the hostname doesn't need to have A RRs for all IPs.

A simple fix would be to exchange the open() function with this code:

    * Open and return the server socket for this Connector.  If an IP
    * address has been specified, the socket will be opened only on that
    * address; otherwise it will be opened on all addresses.
    * @exception IOException if an input/output error occurs
   private ServerSocket open() throws IOException {
       // Acquire the server socket factory for this Connector
       ServerSocketFactory factory = getFactory();

       // If no address is specified, open a connection on all addresses
       if (address == null) {
           return (factory.createSocket(port, acceptCount));

       // Open InetAddress a server socket on the specified address
       // Simply get the InetAddress for the address
log(sm.getString("httpConnector.anAddress", address));
return (factory.createSocket(port, acceptCount,is));

The error check you used before should not be necessary because the 
ServerSocket constructor should throw a IOException if you use a 

Thomas Butter

View raw message