5 Replies Latest reply on Jun 29, 2005 7:46 AM by belaban

    Jgroups. Can I set the unicast adress?

    dnielben

      Hi,

      I am using JGroups and I want to set the unicast adress, to know in advance wich unicast adress will be used by each member of the group. This because I want to use Jgroups as a comunnication framework of a AOP language!.

      Daniel

        • 1. Re: Jgroups. Can I set the unicast adress?
          belaban

          You could use TCP:TCPPING (see docs on jgroups.org).

          • 2. Re: Jgroups. Can I set the unicast adress?
            dnielben

            Hi, again!

            In fact I don't want to use TCP. I know that UDP generates a multicast socket and an unicst socket, as far as i understand the result of getLocalAddress is theunicast address. What i want is to tel UDP exactly what interface and port to use for the unicast address.

            Can I do this?

            Daniel

            • 3. Re: Jgroups. Can I set the unicast adress?
              belaban

              Yes, you can do that: use UDP and set bind_addr (or -Dbind.address=x.x.x.x), and bind_port.

              For lookup, PING still uses IP multicasting to discover the initial membership. If you want unicast-based lookup (a la UDPPING), this doesn't exist. But I wouldn't see the point ot that anyway, except in cases where you cannot enable IP multicasting.

              • 4. Re: Jgroups. Can I set the unicast adress?
                dnielben

                It does not Work!

                Passing the -Dbind.addr and -Dbind.port does not work directly. But reading parameters explicitly and passing them in the stack string does work.

                The example:

                public String getStack(String optionsSetName){
                 return "UDP(mcast_addr=224.0.0.35;mcast_port=45566;ip_ttl=64;" +
                 "ip_mcast=true;mcast_send_buf_size=150000;mcast_recv_buf_size=80000;" +
                 "ucast_send_buf_size=150000;ucast_recv_buf_size=80000;loopback=false;" +
                 "bind_addr=" + System.getProperty("bind.addr") + ";" +
                 "bind_port=" + System.getProperty("bind.port") + "):" + ...


                I send it to complete the post information. If some one interested.

                Daniel

                • 5. Re: Jgroups. Can I set the unicast adress?
                  belaban

                  #1 it is bind.address nor bind.addr
                  #2 I didn't say that bind.port was supported