Examples of joinGroup()


Examples of com.linkedin.databus.groupleader.pub.GroupLeadershipConnection.joinGroup()

        GroupLeadershipConnection conn002 = _groupLeadershipConnFactory.getConnection();
        Assert.assertNull(conn002.getLeaderName(baseName,groupName),"Leader should be null");
        LOG.info("Group should not exist yet Test");
        assertFalse(conn002.getGroupNames(baseName).contains(groupName));

        GroupLeadershipSession sess002 = conn002.joinGroup(baseName,
            groupName, "002", saveCurrentLeaderCallback);

        assertEquals(groupName, sess002.getGroupName());
        assertEquals("002", sess002.getMemberName());
        assertEquals("002", (sess002.getLeaderName()));
View Full Code Here

Examples of com.linkedin.databus.groupleader.pub.GroupLeadershipConnection.joinGroup()



        GroupLeadershipConnection conn001 = _groupLeadershipConnFactory.getConnection();

        GroupLeadershipSession sess001 = conn001.joinGroup(baseName,
            groupName, "001", saveCurrentLeaderCallback);

        assertEquals(groupName, sess001.getGroupName());
        assertEquals("001", sess001.getMemberName());
        assertEquals("002", (sess001.getLeaderName()));
View Full Code Here

Examples of com.linkedin.databus.groupleader.pub.GroupLeadershipConnection.joinGroup()



        GroupLeadershipConnection conn003 = _groupLeadershipConnFactory.getConnection();

        GroupLeadershipSession sess003 = conn003.joinGroup(baseName,
            groupName, "003", saveCurrentLeaderCallback);

        assertEquals(groupName, sess003.getGroupName());
        assertEquals("003", sess003.getMemberName());
        assertEquals("002", (sess003.getLeaderName()));
View Full Code Here

Examples of io.netty.channel.socket.DatagramChannel.joinGroup()

            DatagramChannel datagramChannel = (DatagramChannel) channel;
            String networkInterface = configuration.getNetworkInterface() == null ? LOOPBACK_INTERFACE : configuration.getNetworkInterface();
            multicastNetworkInterface = NetworkInterface.getByName(networkInterface);
            ObjectHelper.notNull(multicastNetworkInterface, "No network interface found for '" + networkInterface + "'.");
            LOG.info("ConnectionlessBootstrap joining {}:{} using network interface: {}", new Object[]{configuration.getHost(), configuration.getPort(), multicastNetworkInterface.getName()});
            datagramChannel.joinGroup(hostAddress, multicastNetworkInterface).syncUninterruptibly();
            allChannels.add(datagramChannel);
        } else {
            LOG.info("ConnectionlessBootstrap binding to {}:{}", configuration.getHost(), configuration.getPort());
            ChannelFuture channelFuture = bootstrap.bind(hostAddress);
            channelFuture.awaitUninterruptibly();
View Full Code Here

Examples of java.net.MulticastSocket.joinGroup()

                try {
                    //fake a discovery server to send back some canned messages.
                    InetAddress address = InetAddress.getByName("239.255.255.250");
                    MulticastSocket s = new MulticastSocket(Integer.parseInt(PORT));
                    s.setBroadcast(true);
                    s.joinGroup(address);
                    s.setReceiveBufferSize(64 * 1024);
                    s.setSoTimeout(5000);
                    byte[] bytes = new byte[64 * 1024];
                    DatagramPacket p = new DatagramPacket(bytes, bytes.length, address, Integer.parseInt(PORT));
                    s.receive(p);
View Full Code Here

Examples of java.net.MulticastSocket.joinGroup()

                }
            }
            else {
                group_addr=InetAddress.getByName("224.0.0.36");
                sock=new MulticastSocket(7777);
                sock.joinGroup(group_addr);
            }

            if(debug) {
                System.out.println("Press key to start");
                System.in.read();
View Full Code Here

Examples of java.net.MulticastSocket.joinGroup()

            return existingKey;
        }

        boolean success = false;
        try {
            msocket.joinGroup(mcastaddr, interf);
            success = true;
            return newKey;
        } finally {
            if (!success) {
                mcastKeys.remove(newKey);
View Full Code Here

Examples of java.net.MulticastSocket.joinGroup()

            InetAddress someInet = InetAddress.getByName(DNSConstants.MDNS_GROUP);
            firstSocket = new MulticastSocket(MPORT);
            secondSocket = new MulticastSocket(MPORT);

            firstSocket.joinGroup(someInet);
            secondSocket.joinGroup(someInet);
            //
            DatagramPacket out = new DatagramPacket(firstMessage.getBytes("UTF-8"), firstMessage.length(), someInet, MPORT);
            DatagramPacket inFirst = new DatagramPacket(firstMessage.getBytes("UTF-8"), firstMessage.length(), someInet, MPORT);
            DatagramPacket inSecond = new DatagramPacket(firstMessage.getBytes("UTF-8"), firstMessage.length(), someInet, MPORT);
            Receive receiveSecond = new Receive(secondSocket, inSecond);
View Full Code Here

Examples of java.net.MulticastSocket.joinGroup()

                String multicastGroup = System.getProperty("hazelcast.multicast.group");
                if (multicastGroup == null) {
                    multicastGroup = multicastConfig.getMulticastGroup();
                }
                multicastConfig.setMulticastGroup(multicastGroup);
                multicastSocket.joinGroup(InetAddress.getByName(multicastGroup));
                multicastSocket.setSoTimeout(1000);
                mcService = new MulticastService(this, multicastSocket);
                mcService.addMulticastListener(new NodeMulticastListener(this));
            }
        } catch (Exception e) {
View Full Code Here

Examples of java.net.MulticastSocket.joinGroup()

         while (nis.hasMoreElements()) {
            retval = new MulticastSocket(port);
            NetworkInterface networkInterface = nis.nextElement();
            retval.setNetworkInterface(networkInterface);
            try {
               retval.joinGroup(mcast_addr);
               String msg = "Successfully bind to " + networkInterface;
               okTrace.append(msg).append('\n');
            } catch (IOException e) {
               e.printStackTrace();
               String msg = "Failed to bind to " + networkInterface + ".";
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.