On 09/10/2011 15:57, Francis Galiegue wrote: > Hello, > > I have my CIDR matching valve/filter ready (still struggling to write > unit tests, but it works in real-world situations), and there is > something I find quite unoptimized: you have getRemoteHost() and > getRemoteAddr() to get the remote host name and IP addresses as > strings, but why can't you get hold of the InetAddress object > directly?
Because Tomcat implements the Servlet specification and the specification does not provide such a method. We can't add such a method since any change to the public API of the Servlet spec would trigger a TCK failure. > It would be much faster to do so... In my valve and filter, I have to > .getRemoteAddr() and create an InetAddress object out of the string... How much faster? What performance penalty are we talking about here? When making any argument based on performance, you really need to provide some hard numbers to put the problem into context. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org