Examples of PeerInfo


Examples of com.googlecode.protobuf.pro.duplex.PeerInfo

        Options options = parseOptions(args);
        log.warn("Options = {}", options.toString());

        double scale = Math.log(options.ratio) / 2;

        Client client = new Client(Collections.singleton(new PeerInfo(options.host, options.port)));

        History recorder = new History(1, 10, 30).logTicks();

        Random gen = RandomUtils.getRandom();
        ChineseRestaurant topicSampler = new ChineseRestaurant(options.alpha);
View Full Code Here

Examples of com.googlecode.protobuf.pro.duplex.PeerInfo

    }

    NetworkCatcherConnection(PeerInfo server) throws IOException {
        logger.info("Connecting to {}", server);
        this.server = server;
        PeerInfo client = new PeerInfo("clientHostname", 9999);
        bootstrap = new DuplexTcpClientBootstrap(
                client,
                new NioClientSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool()));
View Full Code Here

Examples of com.googlecode.protobuf.pro.duplex.PeerInfo

        }

        Properties props = loadProperties();

        int port = Integer.parseInt(args[1]);
        PeerInfo serverInfo = new PeerInfo(args[0], port);
        //You need then to create a DuplexTcpServerBootstrap and provide it an RpcCallExecutor.


        DuplexTcpServerBootstrap bootstrap = new DuplexTcpServerBootstrap(
                serverInfo,
View Full Code Here

Examples of com.googlecode.protobuf.pro.duplex.PeerInfo

            throw e;
        }
    }

    private static DuplexTcpServerBootstrap startProtoServer(int port) {
        PeerInfo serverInfo = new PeerInfo("0.0.0.0", port);
        DuplexTcpServerBootstrap bootstrap = new DuplexTcpServerBootstrap(
                serverInfo,
                new NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool())
View Full Code Here

Examples of com.googlecode.protobuf.pro.duplex.PeerInfo

        // remove all connections that cause an error
        if (pendingConnectionRemovals.size() > 0) {
            allConnections.removeAll(pendingConnectionRemovals);
            for (CatcherConnection connection : pendingConnectionRemovals) {
                PeerInfo pi = connection.getServer();
                if (pi != null) {
                    HostPort hostPort = new HostPort(pi);
                    Long serverId = knownServers.get(hostPort);
                    knownServers.remove(hostPort);
View Full Code Here

Examples of com.googlecode.protobuf.pro.duplex.PeerInfo

                    '}';
        }
    }

    public static void main(String[] args) throws ServiceException, IOException {
        Client c = new Client(ImmutableList.of(new PeerInfo("localhost", 8080)));

        c.sendMessage("this", "hello world");

        c.close();
    }
View Full Code Here

Examples of com.googlecode.protobuf.pro.duplex.PeerInfo

            result = 31 * result + port;
            return result;
        }

        public PeerInfo asPortInfo() {
            return new PeerInfo(host, port);
        }
View Full Code Here

Examples of com.googlecode.protobuf.pro.duplex.PeerInfo

        bootstrap.bind();
    }


    private static DuplexTcpServerBootstrap startProtoServer(int port) {
        PeerInfo serverInfo = new PeerInfo("0.0.0.0", port);
        DuplexTcpServerBootstrap bootstrap = new DuplexTcpServerBootstrap(
                serverInfo,
                new NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool())
View Full Code Here

Examples of com.googlecode.protobuf.pro.duplex.PeerInfo

        Client c = new Client(new ConnectionFactory() {
            @Override
            public CatcherConnection create(PeerInfo server) {
                return null;
            }
        }, Lists.newArrayList(new PeerInfo("foo", 0)));
        try {
            c.sendMessage("topic", "message");
            fail("Should have failed with IOException");
        } catch (IOException e) {
            assertTrue(e.getMessage().contains("No catcher servers"));
View Full Code Here

Examples of com.googlecode.protobuf.pro.duplex.PeerInfo

                    return null;
                } else {
                    return new FakeConnection(server, farm);
                }
            }
        }, Lists.newArrayList(new PeerInfo("foo", 0)));

        c.sendMessage("3", "message");
        assertEquals(1, farm.getMessages().size());
        assertEquals("message", farm.getMessages().get(0));
    }
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.