Package org.jgroups.stack

Examples of org.jgroups.stack.IpAddress


    @BeforeMethod
    protected void init() throws Exception {
        List<Short> ports=ResourceManager.getNextTcpPorts(loopback_addr, 2);
        PORT1=ports.get(0);
        PORT2=ports.get(1);
        addr1=new IpAddress(loopback_addr, PORT1);
        addr2=new IpAddress(loopback_addr, PORT2);
    }
View Full Code Here


   public void setUp()
   {
      control = createStrictControl();
      containerMock = control.createMock(DataContainer.class);
      spiMock = control.createMock(CacheSPI.class);
      command = new LegacyGravitateDataCommand(fqn, true, new IpAddress());
      command.initialize(containerMock, spiMock, new BuddyFqnTransformer());
      ctx = new LegacyInvocationContext(containerMock);
   }
View Full Code Here

   public void testDeadBeackup() throws Exception
   {
      NodeSpiMock root = new NodeSpiMock(Fqn.ROOT);

      //add first dead child
      IpAddress firstAddress = new IpAddress("127.0.0.1", 1234);
      NodeSpiMock firstDeadNode = (NodeSpiMock) root.addChildDirect(fqnTransformer.getDeadBackupRoot(firstAddress));
      firstDeadNode.addChildDirect(Fqn.fromElements(0));
      firstDeadNode.addChildDirect(Fqn.fromElements(1));
      firstDeadNode.addChildDirect(Fqn.fromElements(2));

      //add second dead child
      IpAddress secondAddress = new IpAddress("127.0.0.1", 4321);
      NodeSpiMock secondDeadNode = (NodeSpiMock) root.addChildDirect(fqnTransformer.getDeadBackupRoot(secondAddress));
      secondDeadNode.addChildDirect(Fqn.fromElements(0));


      expect(spiMock.getNode(fqn)).andReturn(null);
View Full Code Here

    public static final int NUM_THREADS=100;


    @BeforeMethod
    void setUp() throws Exception {
        a1=new IpAddress(1111);
        members=new Vector<Address>();
        members.add(a1);
        v=new View(a1, 1, members);
        s=new Simulator();
        s.setLocalAddress(a1);
View Full Code Here

    }

    /*------------------------------ Protocol interface ------------------------------ */

    public void init() throws Exception {
        local_addr=new IpAddress("127.0.0.1", next_port++);
        super.init();
                       
    }
View Full Code Here

    }


    public static void testRemove() throws UnknownHostException {
        AckMcastSenderWindow mywin=new AckMcastSenderWindow(new MyCommand(), new StaticInterval(1000, 2000, 3000));
        Address sender1=new IpAddress("127.0.0.1", 10000);
        Address sender2=new IpAddress("127.0.0.1", 10001);
        Address sender3=new IpAddress("127.0.0.1", 10002);
        Vector senders=new Vector();
        Message msg=new Message();
        long seqno=322649;

        senders.addElement(sender1);
View Full Code Here

            if(disable_loopback)
                mcast_sock.setLoopbackMode(disable_loopback);

            mcast_sock.setTimeToLive(ip_ttl);

            mcast_addr=new IpAddress(mcast_group_addr, mcast_port);

            // check that we're not using the same mcast address and port as the diagnostics socket
            if(enable_diagnostics) {
                if(diagnostics_addr != null && diagnostics_addr.equals(mcast_group_addr) ||
                        diagnostics_port == mcast_port)
View Full Code Here

        closeMulticastSocket();
        closeUnicastSocket();
    }

    protected IpAddress createLocalAddress() {
        return sock != null && !sock.isClosed()? new IpAddress(sock.getLocalAddress(), sock.getLocalPort()) : null;
    }
View Full Code Here

                            log.error("size of the received packet (" + len + ") is bigger than allocated buffer (" +
                                      receive_buf.length + "): will not be able to handle packet. " +
                                      "Use the FRAG2 protocol and make its frag_size lower than " + receive_buf.length);
                    }

                    receive(new IpAddress(packet.getAddress(), packet.getPort()),
                            receive_buf,
                            packet.getOffset(),
                            len);
                }
                catch(SocketException sock_ex) {
View Full Code Here

   // Streamable implementation -------------------------------------

   public void read(DataInputStream in) throws Exception
   {
      syncChannelAddress = new IpAddress();

      syncChannelAddress.readFrom(in);

      asyncChannelAddress = new IpAddress();

      asyncChannelAddress.readFrom(in);

      byte[] byteInput = new byte[in.readInt()];
View Full Code Here

TOP

Related Classes of org.jgroups.stack.IpAddress

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.