Package net.tomp2p.peers

Examples of net.tomp2p.peers.PeerSocketAddress


  }
 
  @Test
  public void testRelay() throws Exception {
    Collection<PeerSocketAddress> psa = new ArrayList<PeerSocketAddress>();
        psa.add(new PeerSocketAddress(InetAddress.getByName("192.168.230.230"), RND.nextInt(BIT_16),
                RND.nextInt(BIT_16)));
        psa.add(new PeerSocketAddress(InetAddress.getByName("2123:4567:89ab:cdef:0123:4567:89ab:cde2"),
                RND.nextInt(BIT_16), RND.nextInt(BIT_16)));
        psa.add(new PeerSocketAddress(InetAddress.getByName("192.168.230.231"), RND.nextInt(BIT_16),
                RND.nextInt(BIT_16)));
        psa.add(new PeerSocketAddress(InetAddress.getByName("4123:4567:89ab:cdef:0123:4567:89ab:cde4"),
                RND.nextInt(BIT_16), RND.nextInt(BIT_16)));
        psa.add(new PeerSocketAddress(InetAddress.getByName("192.168.230.232"), RND.nextInt(BIT_16),
                RND.nextInt(BIT_16)));
        PeerAddress pa3 = new PeerAddress(new Number160("0x657435a424444522456"), new PeerSocketAddress(
                InetAddress.getByName("192.168.230.236"), RND.nextInt(BIT_16), RND.nextInt(BIT_16)), true, true, true, true, false,
                psa);
       
        Message m1 = Utils2.createDummyMessage();
        Collection<PeerAddress> tmp = new ArrayList<PeerAddress>();
View Full Code Here


  }
 
  @Test
  public void testRelay2() throws Exception
        Collection<PeerSocketAddress> psa = new ArrayList<PeerSocketAddress>();
        psa.add(new PeerSocketAddress(InetAddress.getByName("192.168.230.230"), RND.nextInt(BIT_16),
                RND.nextInt(BIT_16)));
        psa.add(new PeerSocketAddress(InetAddress.getByName("2123:4567:89ab:cdef:0123:4567:89ab:cde2"),
                RND.nextInt(BIT_16), RND.nextInt(BIT_16)));
        psa.add(new PeerSocketAddress(InetAddress.getByName("192.168.230.231"), RND.nextInt(BIT_16),
                RND.nextInt(BIT_16)));
        psa.add(new PeerSocketAddress(InetAddress.getByName("4123:4567:89ab:cdef:0123:4567:89ab:cde4"),
                RND.nextInt(BIT_16), RND.nextInt(BIT_16)));
        psa.add(new PeerSocketAddress(InetAddress.getByName("192.168.230.232"), RND.nextInt(BIT_16),
                RND.nextInt(BIT_16)));
        PeerAddress pa3 = new PeerAddress(new Number160("0x657435a424444522456"), new PeerSocketAddress(
                InetAddress.getByName("192.168.230.236"), RND.nextInt(BIT_16), RND.nextInt(BIT_16)), true, true, true, true, true,
                psa);
       
        Message m1 = Utils2.createDummyMessage();
        Collection<PeerAddress> tmp = new ArrayList<PeerAddress>();
View Full Code Here

      if(list.size() >= relayType.maxRelayCount()) {
        Iterator<PeerSocketAddress> iterator = list.iterator();
        iterator.next();
        iterator.remove();
      }
      list.add(new PeerSocketAddress(InetAddress.getByName("10.10.10.10"), 10, 10));
      unreachablePeer2.peerBean().serverPeerAddress(unreachablePeer2.peerBean().serverPeerAddress().changePeerSocketAddresses(list));
           
      System.err.println("unreachablePeer1: " + unreachablePeer1.peerAddress());
      System.err.println("unreachablePeer2: "+unreachablePeer2.peerAddress());
     
View Full Code Here

    //this is just a guess and will be changed once discovery is done
    InetAddress outsideAddress = discoverResults.foundAddress();
    if(outsideAddress == null) {
      throw new IOException("Not listening to anything. Maybe your binding information is wrong.");
    }
    final PeerSocketAddress peerSocketAddress = new PeerSocketAddress(outsideAddress, channelServerConfiguration.
        ports().tcpPort(), channelServerConfiguration.ports().udpPort());
    final PeerAddress self = new PeerAddress(peerId, peerSocketAddress,
            channelServerConfiguration.isBehindFirewall(), channelServerConfiguration.isBehindFirewall(), false, false, false,
            PeerAddress.EMPTY_PEER_SOCKET_ADDRESSES);
    return self;
View Full Code Here

TOP

Related Classes of net.tomp2p.peers.PeerSocketAddress

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.