Examples of IpAddress


Examples of org.contikios.cooja.interfaces.IPAddress

  public void paintBeforeMotes(Graphics g) {
  }

  private static String getMoteString(Mote mote) {
    IPAddress ipAddr = mote.getInterfaces().getIPAddress();
    if (ipAddr != null && ipAddr.getIPString() != null) {
      return ipAddr.getIPString();
    }

    RimeAddress rimeAddr = mote.getInterfaces().getRimeAddress();
    if (rimeAddr != null) {
      return rimeAddr.getAddressString();
View Full Code Here

Examples of org.jclouds.trmk.vcloud_0_8.domain.IpAddress

            status = IpAddress.Status.fromValue(current);
         } else if (!skip && qName.equals("Server")) {
            server = current;
         }
      } else if (qName.equals("IpAddress")) {
         addresses.add(new IpAddress(address, status, server));
         address = null;
         status = null;
         server = null;
      }
      currentText = new StringBuilder();
View Full Code Here

Examples of org.jgroups.stack.IpAddress

            Util.close(bos);
        }
    }

    private void connectToStateProvider(StateHeader hdr) {
        IpAddress address = hdr.bind_addr;
        String tmp_state_id = hdr.getStateId();
        InputStream bis = null;
        StateTransferInfo sti = null;
        Socket socket = new Socket();
        try {
            socket.bind(new InetSocketAddress(bind_addr, 0));
            int bufferSize = socket.getReceiveBufferSize();
            socket.setReceiveBufferSize(socket_buffer_size);
            if (log.isDebugEnabled())
                log.debug("Connecting to state provider " + address.getIpAddress() + ":"
                        + address.getPort() + ", original buffer size was " + bufferSize
                        + " and was reset to " + socket.getReceiveBufferSize());
           
            Util.connect(socket, new InetSocketAddress(address.getIpAddress(), address.getPort()), 0);
            if (log.isDebugEnabled())
                log.debug("Connected to state provider, my end of the socket is "
                        + socket.getLocalAddress() + ":" + socket.getLocalPort()
                        + " passing inputstream up...");
View Full Code Here

Examples of org.jgroups.stack.IpAddress

        public StateProviderThreadSpawner(ExecutorService pool, ServerSocket stateServingSocket) {
            super();
            this.pool = pool;
            this.serverSocket = stateServingSocket;
            this.address = new IpAddress(STREAMING_STATE_TRANSFER.this.bind_addr, serverSocket.getLocalPort());
        }
View Full Code Here

Examples of org.jgroups.stack.IpAddress

    public void testRegularMessages() throws Exception {
        FragReceiver frag_receiver=new FragReceiver(this);
        ProtocolTester t=new ProtocolTester("FRAG2(frag_size=" + FRAG_SIZE + ')', frag_receiver);
        Message big_msg;
        IpAddress local_addr=new IpAddress(5555);

        System.out.println("\nProtocol for protocol tester: " + t.getProtocolSpec() + '\n');

        for(int i=0; i < NUM_MSGS; i++) {
            big_msg=createBigMessage(MSG_SIZE);
View Full Code Here

Examples of org.jgroups.stack.IpAddress

    public void testMessagesWithOffsets() throws Exception {
        FragReceiver frag_receiver=new FragReceiver(this);
        ProtocolTester t=new ProtocolTester("FRAG2(frag_size=" + FRAG_SIZE + ')', frag_receiver);
        Message big_msg;
        IpAddress local_addr=new IpAddress(5555);

        System.out.println("\nProtocol for protocol tester: " + t.getProtocolSpec() + '\n');

        byte[] big_buffer=new byte[(int)(MSG_SIZE * NUM_MSGS)];

 
View Full Code Here

Examples of org.jgroups.stack.IpAddress

                // fix to prevent exception by JBossAS, which checks whether a physical
                // address is present and throw an ex if not
                // Remove this when the AS code removes that check
                PhysicalAddress addr=(PhysicalAddress)down_prot.down(evt);
                if(addr == null)
                    addr=new IpAddress(6666);
                return addr;
        }
        return down_prot.down(evt);
    }
View Full Code Here

Examples of org.jgroups.stack.IpAddress

    public static void testPingData() throws Exception {
        PingData data;
        final Address own=org.jgroups.util.UUID.randomUUID();
        final Address coord=org.jgroups.util.UUID.randomUUID();
        final PhysicalAddress physical_addr_1=new IpAddress("127.0.0.1", 7500);
        final PhysicalAddress physical_addr_2=new IpAddress("192.168.1.5", 6000);
        final PhysicalAddress physical_addr_3=new IpAddress("192.134.2.1", 6655);
        final Address self=Util.createRandomAddress();

        data=new PingData(null, null, false);
        _testSize(data);

        data=new PingData(own, Util.createView(coord, 22, coord, Util.createRandomAddress()), false);
        _testSize(data);

        data=new PingData(null, null, false, "node-1", null);
        _testSize(data);

        data=new PingData(own, Util.createView(coord, 22, coord), false, "node-1", null);
        _testSize(data);

        data=new PingData(own, Util.createView(coord, 22, coord), false, "node-1", new ArrayList<PhysicalAddress>(7));
        _testSize(data);

        data=new PingData(null, null, false, "node-1", new ArrayList<PhysicalAddress>(7));
        _testSize(data);

        List<PhysicalAddress> list=new ArrayList<PhysicalAddress>();
        list.add(physical_addr_1);
        list.add(physical_addr_2);
        list.add(physical_addr_3);
        data=new PingData(null, null, false, "node-1", list);
        _testSize(data);

        list.clear();
        list.add(new IpAddress("127.0.0.1", 7500));
        data=new PingData(null, null, false, "node-1", list);
        _testSize(data);

        View view=Util.createView(coord, 322649, coord, own, UUID.randomUUID());
        data.setView(view);
View Full Code Here

Examples of org.jgroups.stack.IpAddress

        final Address own=org.jgroups.util.UUID.randomUUID();
        final Address coord=org.jgroups.util.UUID.randomUUID();
        UUID.add((UUID)own, "own");
        UUID.add((UUID)coord, "coord");

        final PhysicalAddress physical_addr_1=new IpAddress("127.0.0.1", 7500);
        final PhysicalAddress physical_addr_2=new IpAddress("192.168.1.5", 6000);
        final PhysicalAddress physical_addr_3=new IpAddress("192.134.2.1", 6655);

        _testSize(new GossipData());

        data=new GossipData((byte)1);
        _testSize(data);
View Full Code Here

Examples of org.jgroups.stack.IpAddress

    public static void testFdHeaders() throws Exception {
        FD.FdHeader hdr=new FD.FdHeader(FD.FdHeader.HEARTBEAT_ACK);
        _testSize(hdr);

        IpAddress a1=new IpAddress("127.0.0.1", 5555);
        IpAddress a2=new IpAddress("127.0.0.1", 6666);
        Vector<Address> suspects=new Vector<Address>();
        suspects.add(a1);
        suspects.add(a2);
        hdr=new FD.FdHeader(FD.FdHeader.SUSPECT, suspects, a1);
        _testSize(hdr);

        FD_SOCK.FdHeader sockhdr=new FD_SOCK.FdHeader(FD_SOCK.FdHeader.GET_CACHE);
        _testSize(sockhdr);

        sockhdr=new FD_SOCK.FdHeader(FD_SOCK.FdHeader.SUSPECT, new IpAddress("127.0.0.1", 5555));
        _testSize(sockhdr);

        Set<Address> tmp=new HashSet<Address>();
        tmp.add(a1);
        tmp.add(a2);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.