public void testSingleDataSendNO_ACK() throws Exception { AbstractSender s1 = (AbstractSender) ((ReplicationTransmitter) channel1.getChannelSender()).getTransport(); AbstractSender s2 = (AbstractSender) ((ReplicationTransmitter) channel2.getChannelSender()).getTransport(); s1.setTimeout(Long.MAX_VALUE); // for debugging s2.setTimeout(Long.MAX_VALUE); // for debugging System.err.println("Starting Single package NO_ACK"); channel1.send( new Member[] {channel2.getLocalMember(false)}, Data.createRandomData(1024), Channel.SEND_OPTIONS_UDP); Thread.sleep(500); System.err.println("Finished Single package NO_ACK [" + listener1.count + "]"); assertEquals("Checking success messages.", 1, listener1.count.get()); }
@Override public DataSender getNewDataSender() { try { ParallelNioSender sender = new ParallelNioSender(); AbstractSender.transferProperties(this, sender); return sender; } catch (IOException x) { throw new RuntimeException("Unable to open NIO selector.", x); } }
public static void startManagers() { AbstractSender.startManagers(); try { if (gerenciadornuvem0 == null) gerenciadornuvem0 = (Gerenciadornuvem0Interface) Naming.lookup("rmi://0:1099/gerenciadornuvem0"); if (gerenciadornuvem1 == null) gerenciadornuvem1 = (Gerenciadornuvem1Interface) Naming.lookup("rmi://1:1099/gerenciadornuvem1"); } catch (RemoteException e) { e.printStackTrace(); } catch (NotBoundException e) { e.printStackTrace(); } catch (MalformedURLException e) { e.printStackTrace(); } }
@Override public void finalize() throws Throwable { try { try { disconnect(); } catch (Exception e) { /* Ignore */ } try { selector.close(); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("Failed to close selector", e); } } super.finalize(); } catch (Exception excp) { excp.printStackTrace(); } }
/** * transfers sender properties from one sender to another * * @param from AbstractSender * @param to AbstractSender */ public static void transferProperties(AbstractSender from, AbstractSender to) { to.rxBufSize = from.rxBufSize; to.txBufSize = from.txBufSize; to.directBuffer = from.directBuffer; to.keepAliveCount = from.keepAliveCount; to.keepAliveTime = from.keepAliveTime; to.timeout = from.timeout; to.destination = from.destination; to.address = from.address; to.port = from.port; to.maxRetryAttempts = from.maxRetryAttempts; to.tcpNoDelay = from.tcpNoDelay; to.soKeepAlive = from.soKeepAlive; to.ooBInline = from.ooBInline; to.soReuseAddress = from.soReuseAddress; to.soLingerOn = from.soLingerOn; to.soLingerTime = from.soLingerTime; to.soTrafficClass = from.soTrafficClass; to.throwOnFailedAck = from.throwOnFailedAck; to.udpBased = from.udpBased; to.udpPort = from.udpPort; }