/** * This sends a message broadcasting out that the host and port is available for connections. * <p> * It uses the vmid as the requesterDI * @param host * @param port * @param cacheNames * @throws IOException */ public void passiveBroadcast( String host, int port, ArrayList<String> cacheNames ) throws IOException { passiveBroadcast( host, port, cacheNames, CacheInfo.listenerId ); }
/** * This sends a message broadcasting out that the host and port is available for connections. * <p> * It uses the vmid as the requesterDI * @param host * @param port * @param cacheNames * @throws IOException */ public void passiveBroadcast( String host, int port, ArrayList<String> cacheNames ) throws IOException { passiveBroadcast( host, port, cacheNames, CacheInfo.listenerId ); }
sender.passiveBroadcast( attributes.getServiceAddress(), attributes.getServicePort(), cacheNames );
sender.passiveBroadcast( attributes.getServiceAddress(), attributes.getServicePort(), cacheNames );
getUdpDiscoveryAttributes().getUdpDiscoveryPort() ); sender1.passiveBroadcast( getUdpDiscoveryAttributes().getServiceAddress(), getUdpDiscoveryAttributes() .getServicePort(), this.getCacheNames() );
getUdpDiscoveryAttributes().getUdpDiscoveryPort() ); sender1.passiveBroadcast( getUdpDiscoveryAttributes().getServiceAddress(), getUdpDiscoveryAttributes() .getServicePort(), this.getCacheNames() );
/** * Test sending a live messages. * <p> * @throws Exception on error */ public void testPassiveBroadcast() throws Exception { // SETUP ArrayList<String> cacheNames = new ArrayList<String>(); // DO WORK sender.passiveBroadcast( SENDING_HOST, SENDING_PORT, cacheNames, 1L ); // VERIFY // grab the sent message Object obj = receiver.waitForMessage() ; assertTrue( "unexpected crap received", obj instanceof UDPDiscoveryMessage ); UDPDiscoveryMessage msg = (UDPDiscoveryMessage) obj; // disabled test because of JCS-89 // assertEquals( "wrong host", SENDING_HOST, msg.getHost() ); assertEquals( "wrong port", SENDING_PORT, msg.getPort() ); assertEquals( "wrong message type", BroadcastType.PASSIVE, msg.getMessageType() ); }
/** * Test sending a live messages. * <p> * @throws Exception on error */ public void testPassiveBroadcast() throws Exception { // SETUP ArrayList<String> cacheNames = new ArrayList<String>(); // DO WORK sender.passiveBroadcast( SENDING_HOST, SENDING_PORT, cacheNames, 1L ); // VERIFY // grab the sent message Object obj = receiver.waitForMessage() ; assertTrue( "unexpected crap received", obj instanceof UDPDiscoveryMessage ); UDPDiscoveryMessage msg = (UDPDiscoveryMessage) obj; // disabled test because of JCS-89 // assertEquals( "wrong host", SENDING_HOST, msg.getHost() ); assertEquals( "wrong port", SENDING_PORT, msg.getPort() ); assertEquals( "wrong message type", BroadcastType.PASSIVE, msg.getMessageType() ); }
for ( ; cnt < max; cnt++ ) sender.passiveBroadcast( "localhost", 1111, cacheNames, 1 ); SleepUtil.sleepAtLeast( 20 );
for ( ; cnt < max; cnt++ ) sender.passiveBroadcast( "localhost", 1111, cacheNames, 1 ); SleepUtil.sleepAtLeast( 20 );