/** * Set up the receiver. Maybe better to just code sockets here? Set up the sender for sending * the message. * <p> * @throws Exception on error */ @Override protected void setUp() throws Exception { super.setUp(); receiver = new UDPDiscoveryReceiver( null, ADDRESS, PORT ); sender = new UDPDiscoverySender( ADDRESS, PORT ); }
/** * Set up the receiver. Maybe better to just code sockets here? Set up the sender for sending * the message. * <p> * @throws Exception on error */ @Override protected void setUp() throws Exception { super.setUp(); receiver = new UDPDiscoveryReceiver( null, ADDRESS, PORT ); sender = new UDPDiscoverySender( ADDRESS, PORT ); }
receiver = new UDPDiscoveryReceiver( this, getUdpDiscoveryAttributes().getUdpDiscoveryAddr(), getUdpDiscoveryAttributes().getUdpDiscoveryPort() ); udpReceiverThread = new Thread( receiver );
/** * @param attributes */ public UDPDiscoveryService( UDPDiscoveryAttributes attributes) { udpDiscoveryAttributes = (UDPDiscoveryAttributes) attributes.clone(); try { // todo, you should be able to set this udpDiscoveryAttributes.setServiceAddress( HostNameUtil.getLocalHostAddress() ); } catch ( UnknownHostException e ) { log.error( "Couldn't get localhost address", e ); } try { // todo need some kind of recovery here. receiver = new UDPDiscoveryReceiver( this, getUdpDiscoveryAttributes().getUdpDiscoveryAddr(), getUdpDiscoveryAttributes().getUdpDiscoveryPort() ); } catch ( IOException e ) { log.error( "Problem creating UDPDiscoveryReceiver, address [" + getUdpDiscoveryAttributes().getUdpDiscoveryAddr() + "] port [" + getUdpDiscoveryAttributes().getUdpDiscoveryPort() + "] we won't be able to find any other caches", e ); } // create a sender thread sender = new UDPDiscoverySenderThread( getUdpDiscoveryAttributes(), getCacheNames() ); }
UDPDiscoveryReceiver receiver = new UDPDiscoveryReceiver( service, attributes.getUdpDiscoveryAddr(), attributes .getUdpDiscoveryPort() ); Thread t = new Thread( receiver );
UDPDiscoveryReceiver receiver = new UDPDiscoveryReceiver( service, attributes.getUdpDiscoveryAddr(), attributes .getUdpDiscoveryPort() ); Thread t = new Thread( receiver );