activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiram Chirino <chir...@gmail.com>
Subject Re: What is this code trying to do???
Date Fri, 06 Feb 2009 19:57:55 GMT
Idea is this:

Usually when users bind tcp://localhsot:61616 for a server port they
usually want to bind to all interfaces not just 127.0.0.1.
And I THINK you can argue the same case when the user replaces
'localhost' with the hostname of the machine.

IMHO the only time a user is requesting to bind to specific interface
is when he explicity provides and IP address.  Like:
tcp://127.0.0.1:61616, should only bind to the 127.0.0.1 interface.

Regards,
Hiram

On Fri, Feb 6, 2009 at 1:36 PM, David Jencks <david_jencks@yahoo.com> wrote:
> I'd like to apply the patch for AMQ-2094
>
> Index:
> src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
> ===================================================================
> --- src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
>     (revision 740246)
> +++ src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
>     (working copy)
> @@ -130,11 +130,8 @@
>         InetAddress addr = InetAddress.getByName(host);
>
>         try {
> -            if (host.trim().equals("localhost") ||
> addr.equals(InetAddress.getLocalHost())) {
> -                this.serverSocket =
> serverSocketFactory.createServerSocket(bind.getPort(), backlog);
> -            } else {
> -                this.serverSocket =
> serverSocketFactory.createServerSocket(bind.getPort(), backlog, addr);
> -            }
> +
> +            this.serverSocket =
> serverSocketFactory.createServerSocket(bind.getPort(), backlog, addr);
>             configureServerSocket(this.serverSocket);
>
> because as noted in the comment to the issue if host is the actual ip
> address then addr.equals(InetAddress.getLocalHost()) is always true.
>
> However I wonder if there is some purpose to the existing code that should
> be implemented properly?
>
> If no one speaks up in a bit I'm going to go ahead and apply the patch.
>
> thanks
> david jencks
>
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com

Mime
View raw message