Package net.tomp2p.peers

Examples of net.tomp2p.peers.PeerAddress


    addTrackerDataListener(futureResponse, new Number320(builder.locationKey(), builder.domainKey()));
    RequestHandler<FutureResponse> requestHandler = new RequestHandler<FutureResponse>(futureResponse, peerBean(),
            connectionBean(), builder);

    TrackerData trackerData = new TrackerData(new HashMap<PeerStatistic, Data>());
    PeerAddress peerAddressToAnnounce = builder.peerAddressToAnnounce();
    if (peerAddressToAnnounce == null) {
      peerAddressToAnnounce = peerBean().serverPeerAddress();
    }
    trackerData.put(new PeerStatistic(peerAddressToAnnounce), builder.attachement());
    trackerData = UtilsTracker.limit(trackerData, TrackerRPC.MAX_MSG_SIZE_UDP);
View Full Code Here


    @Test
    @Ignore
    public void startClient() throws IOException, ClassNotFoundException, InterruptedException {
        Peer myPeer = new PeerBuilder(Number160.createHash("client peer")).behindFirewall(true).
                ports(port).enableMaintenance(false).start();
        PeerAddress bootstrapServerPeerAddress = new PeerAddress(Number160.ZERO, new InetSocketAddress(
                InetAddress.getByName(ipSuperPeer), port));

        FutureDiscover discovery = myPeer.discover().peerAddress(bootstrapServerPeerAddress).start();
        discovery.awaitUninterruptibly();
        if (!discovery.isSuccess()) {
View Full Code Here

    final Number160 idP1 = Number160.createHash("p1");
    final Number160 idP2 = Number160.createHash("p2");
    PeerDHT p1 = new PeerBuilderDHT(new PeerBuilder(idP1).ports(1234).start()).start();
    PeerDHT p2 = new PeerBuilderDHT(new PeerBuilder(idP2).ports(1235).start()).start();
    BootstrapBuilder b = p2.peer().bootstrap();
    b.bootstrapTo(Arrays.asList(new PeerAddress(idP1, "localhost", 1234, 1234)));
    b.start().awaitUninterruptibly();

    p1.peer().objectDataReply(new ObjectDataReply() {
      @Override
      public Object reply(PeerAddress sender, Object request) throws Exception {
View Full Code Here

  public static void startClientNAT(String ip) throws Exception {
    Random r = new Random(43L);
    Peer peer = new PeerBuilder(new Number160(r)).ports(PORT_CLIENT).behindFirewall().start();
    PeerNAT peerNAT = new PeerBuilderNAT(peer).start();
    PeerAddress pa = new PeerAddress(Number160.ZERO, InetAddress.getByName(ip), PORT_SERVER, PORT_SERVER);
   
    FutureDiscover fd = peer.discover().peerAddress(pa).start();
    FutureNAT fn = peerNAT.startSetupPortforwarding(fd);
    FutureRelayNAT frn = peerNAT.startRelay(fd, fn);
   
View Full Code Here

public class TestTrackerStorage {
 
  @Test
  public void testStoragePutGetVerified() throws IOException, ClassNotFoundException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(10, new int[] { 10 }, 1, pm, selfAddress, false);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

  }
 
  @Test
  public void testStoragePutGetUnverified() throws IOException, ClassNotFoundException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(10, new int[] { 10 }, 1, pm, selfAddress, true);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

  }
 
  @Test
  public void testStoragePutGetUnverifiedVerified() throws IOException, ClassNotFoundException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(Integer.MAX_VALUE, new int[] { 10 }, 1, pm, selfAddress, true);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

  }
 
  @Test
  public void testStoragePutGetUnverifiedVerifiedSecurity() throws IOException, ClassNotFoundException, NoSuchAlgorithmException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(Integer.MAX_VALUE, new int[] { 10 }, 1, pm, selfAddress, true);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

  }
 
  @Test
  public void testTrackerRemove1() throws IOException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(10, new int[] { 10 }, 1, pm, selfAddress, false);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

  }
 
  @Test
  public void testTrackerRemove2() throws IOException {
    Number160 self = Number160.ONE;
    PeerAddress selfAddress = new PeerAddress(self);
    PeerMapConfiguration pmc = new PeerMapConfiguration(self);
    PeerMap pm = new PeerMap(pmc);
    TrackerStorage trackerStorage = new TrackerStorage(10, new int[] { 10 }, 1, pm, selfAddress, true);

    Number320 n320 = new Number320(Number160.ZERO, Number160.ZERO);
View Full Code Here

TOP

Related Classes of net.tomp2p.peers.PeerAddress

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.