Package net.tomp2p.connection

Examples of net.tomp2p.connection.ChannelServerConfiguration


        try {
            final int port1 = 4001;
            final int port2 = 4002;
            final int timeout = 20;
           
            ChannelServerConfiguration csc = PeerBuilder.createDefaultChannelServerConfiguration();
        ChannelClientConfiguration ccc = PeerBuilder.createDefaultChannelClientConfiguration();
        csc.pipelineFilter(createFilter());
        ccc.pipelineFilter(createFilter());
           
            peer1 = new PeerBuilder(new Number160(RND)).ports(port1).channelClientConfiguration(ccc).channelServerConfiguration(csc).start();
            peer2 = new PeerBuilder(new Number160(RND)).ports(port2).start();
            //
View Full Code Here


          retVal.put("counter", new Pair<EventExecutorGroup, ChannelHandler>(null, tcp? ccohTCP:ccohUDP));
          retVal.putAll(channelHandlers);
          return retVal;
        }
      };
      ChannelServerConfiguration csc = PeerBuilder.createDefaultChannelServerConfiguration();
      ChannelClientConfiguration ccc = PeerBuilder.createDefaultChannelClientConfiguration();
      csc.pipelineFilter(pf);
      ccc.pipelineFilter(pf);
         
            Bindings b1 = new Bindings().addProtocol(StandardProtocolFamily.INET).addAddress(InetAddress.getByName("127.0.0.1"));
            Bindings b2 = new Bindings().addProtocol(StandardProtocolFamily.INET).addAddress(InetAddress.getByName("127.0.0.1"));
           
View Full Code Here

    }
   
  }

  private Peer createPeer(int port) throws IOException {
    ChannelServerConfiguration csc = PeerBuilder.createDefaultChannelServerConfiguration();
    csc.ports(new Ports(port, port));
    csc.portsForwarding(new Ports(port, port));
    csc.connectionTimeoutTCPMillis(10 * 1000);
    csc.idleTCPSeconds(10);
    csc.idleUDPSeconds(10);
   
    return new PeerBuilder(new Number160(port)).ports(port).channelServerConfiguration(csc).start();
  }
View Full Code Here

        final AtomicInteger progressComplete = new AtomicInteger(0);
        final AtomicInteger progressNotComplete = new AtomicInteger(0);
        try {

            PeerBuilder pm1 = new PeerBuilder(new Number160("0x50")).p2pId(55).ports(2424);
            ChannelServerConfiguration css = pm1.createDefaultChannelServerConfiguration();
            css.idleTCPSeconds(Integer.MAX_VALUE);
            pm1.channelServerConfiguration(css);
            sender = pm1.start();

            PeerBuilder pm2 = new PeerBuilder(new Number160("0x20")).p2pId(55).ports(8088);
            pm2.channelServerConfiguration(css);
View Full Code Here

          retVal.put("counter", new Pair<EventExecutorGroup, ChannelHandler>(null, tcp? ccohTCP:ccohUDP));
          retVal.putAll(channelHandlers);
          return retVal;
        }
      };
      ChannelServerConfiguration csc = PeerBuilder.createDefaultChannelServerConfiguration();
      ChannelClientConfiguration ccc = PeerBuilder.createDefaultChannelClientConfiguration();
      csc.pipelineFilter(pf);
      ccc.pipelineFilter(pf);
            sender = new PeerBuilder(new Number160("0x50")).p2pId(55).enableMaintenance(false).ports(2424).channelClientConfiguration(ccc).channelServerConfiguration(csc).start();
            recv1 = new PeerBuilder(new Number160("0x20")).p2pId(55).enableMaintenance(false).ports(8088).channelClientConfiguration(ccc).channelServerConfiguration(csc).start();
            recv1.objectDataReply(new ObjectDataReply() {
                @Override
View Full Code Here

          retVal.put("counter", new Pair<EventExecutorGroup, ChannelHandler>(null, tcp? ccohTCP:ccohUDP));
          retVal.putAll(channelHandlers);
          return retVal;
        }
      };
      ChannelServerConfiguration csc = PeerBuilder.createDefaultChannelServerConfiguration();
      ChannelClientConfiguration ccc = PeerBuilder.createDefaultChannelClientConfiguration();
      csc.pipelineFilter(pf);
      ccc.pipelineFilter(pf);
            sender = new PeerBuilder(new Number160("0x50")).p2pId(55).ports(2424).enableMaintenance(false)
                    .channelClientConfiguration(ccc).channelServerConfiguration(csc).start();
            recv1 = new PeerBuilder(new Number160("0x20")).p2pId(55).ports(8088).enableMaintenance(false)
                .channelClientConfiguration(ccc).channelServerConfiguration(csc).start();
View Full Code Here

        PeerDHT sender = null;
        PeerDHT recv1 = null;
        ChannelCreator cc = null;
        try {
            PeerBuilder pm1 = new PeerBuilder(new Number160("0x50")).p2pId(55).ports(2424);
            ChannelServerConfiguration css = PeerBuilder.createDefaultChannelServerConfiguration();
            css.idleTCPSeconds(Integer.MAX_VALUE);
            pm1.channelServerConfiguration(css);
            sender = new PeerBuilderDHT(pm1.start()).storage(storeSender).start();

            PeerBuilder pm2 = new PeerBuilder(new Number160("0x20")).p2pId(55).ports(8088);
            pm2.channelServerConfiguration(css);
View Full Code Here

        PeerDHT sender = null;
        PeerDHT recv1 = null;
        ChannelCreator cc = null;
        try {
            PeerBuilder pm1 = new PeerBuilder(new Number160("0x50")).p2pId(55).ports(2424);
            ChannelServerConfiguration css = PeerBuilder.createDefaultChannelServerConfiguration();
            css.idleTCPSeconds(Integer.MAX_VALUE);
            pm1.channelServerConfiguration(css);
            sender = new PeerBuilderDHT(pm1.start()).storage(storeSender).start();

            PeerBuilder pm2 = new PeerBuilder(new Number160("0x20")).p2pId(55).ports(8088);
            pm2.channelServerConfiguration(css);
View Full Code Here

        PeerDHT recv1 = null;
        ChannelCreator cc = null;
        try {

            PeerBuilder pm1 = new PeerBuilder(new Number160("0x50")).p2pId(55).ports(2424);
            ChannelServerConfiguration css = PeerBuilder.createDefaultChannelServerConfiguration();
            css.idleTCPSeconds(Integer.MAX_VALUE);
            pm1.channelServerConfiguration(css);
            sender = new PeerBuilderDHT(pm1.start()).storage(storeSender).start();

            PeerBuilder pm2 = new PeerBuilder(new Number160("0x20")).p2pId(55).ports(8088);
            pm2.channelServerConfiguration(css);
View Full Code Here

    }
    return peer;
  }

  public static ChannelServerConfiguration createDefaultChannelServerConfiguration() {
    ChannelServerConfiguration channelServerConfiguration = new ChannelServerConfiguration();
    channelServerConfiguration.bindings(new Bindings());
    //these two values may be overwritten in the peer builder
    channelServerConfiguration.ports(new Ports(Ports.DEFAULT_PORT, Ports.DEFAULT_PORT));
    channelServerConfiguration.portsForwarding(new Ports(Ports.DEFAULT_PORT, Ports.DEFAULT_PORT));
    channelServerConfiguration.behindFirewall(false);
    channelServerConfiguration.pipelineFilter(new DefaultPipelineFilter());
    channelServerConfiguration.signatureFactory(new DSASignatureFactory());
    return channelServerConfiguration;
  }
View Full Code Here

TOP

Related Classes of net.tomp2p.connection.ChannelServerConfiguration

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.