2 Replies Latest reply on Jul 9, 2009 11:01 PM by Ron Sigal

    clientConnectAddress not working

    mazz Master

      I am using JBoss/Remoting 2.2.2-SP8 and trying to see how it can be used with NAT involved (where a server binds to one address but my clients need to access it over a different IP).

      So, here's a simple test I performed to see if clientConnectAddress works.

      I have a remoting client that tries to connect to my server using this invoker URL:

      socket://10.10.10.10:1000/?clientConnectAddress=22.22.22.22

      My clients must go over the IP 22.22.22.22 to reach my server because I bound the server to 22.22.22.22. 10.10.10.10 is a bogus IP but it shouldn't matter, because the client should use the clientConnectAddress for the IP it uses to connect to the server. Right?

      But using that InvokerLocator above, it fails. But if I use this:

      socket://22.22.22.22:1000/?clientConnectAddress=22.22.22.22

      or this

      socket://22.22.22.22:1000

      it works fine.

      I tried stepping through the code in a debugger but I can't see where "clientConnectAddress" is even referenced. Where is that looked up and used?

      I assume I'm doing something stupid - I'm hoping someone can straighten me out.

        • 1. Re: clientConnectAddress not working
          mazz Master

          I'm trying other things - specifically using "serverBindAddress" and that seems to work better.

          Did something happen to the Jboss/Remoting client such that it no longer uses or refers to "clientConnectAddress"?? No matter what I do, I can't get the client to behave any differently, specifying clientConnectAddress or not - as if it isn't supported on the client anymore.

          • 2. Re: clientConnectAddress not working
            Ron Sigal Master

            Hi John,

            The fact is that "clientConnectAddress" is used only on the server side by org.jboss.remoting.transport.transport.Connector to generate an InvokerLocator from a declarative XML configuration (e.g., an MBean). So, for example,

            <mbean code="org.jboss.remoting.transport.Connector"
             name="jboss.remoting:service=Connector,transport=Socket"
             display-name="Socket transport Connector">
            
             <attribute name="Configuration">
             <config>
             <invoker transport="socket">
             <attribute name="serverBindAddress">192.168.0.82</attribute>
             <attribute name="clientConnectAddress">216.23.33.2</attribute>
             ...
            


            will cause the server to bind to 192.168.0.82 but will lead to the InvokerLocator

            socket://216.23.33.2 ...
            


            It is thus that the value of "clientConnectAddress" is communicated to the client, which looks only at the address in the InvokerLocator.

            The discussion in Remoting Guide must be lacking, so I've created JIRA-1142 "Clarify use of "clientConnectAddress" in RemotingGuide" to remind me to extend it.

            -Ron