protected void sendToAll(ByteBuffer data) { for(Map.Entry<Address,Connection> entry: conns.entrySet()) { Connection conn=entry.getValue(); try { conn.send(data.duplicate()); } catch(Throwable ex) { Address dest=entry.getKey(); removeConnectionIfPresent(dest, conn); log.error("failed sending data to %s: %s", dest, ex); } } }
protected void sendToAll(byte[] data, int offset, int length) { for(Map.Entry<Address,Connection> entry: conns.entrySet()) { Connection conn=entry.getValue(); try { conn.send(data, offset, length); } catch(Throwable ex) { Address dest=entry.getKey(); removeConnectionIfPresent(dest, conn); log.error("failed sending data to %s: %s", dest, ex); } } }
public void send(Address dest, byte[] data, int offset, int length) throws Exception { if(!validateArgs(dest, data)) return; if(dest == null) { sendToAll(data, offset, length); return; } if(dest.equals(local_addr)) { receive(dest, data, offset, length); return; } // Get a connection (or create one if not yet existent) and send the data Connection conn=null; try { conn=getConnection(dest); conn.send(data, offset, length); } catch(Exception ex) { removeConnectionIfPresent(dest, conn); throw ex; } }
public void send(Address dest, ByteBuffer data) throws Exception { if(!validateArgs(dest, data)) return; if(dest == null) { sendToAll(data); return; } if(dest.equals(local_addr)) { receive(dest, data); return; } // Get a connection (or create one if not yet existent) and send the data Connection conn=null; try { conn=getConnection(dest); conn.send(data); } catch(Exception ex) { removeConnectionIfPresent(dest, conn); throw ex; } }
protected void sendToAll(ByteBuffer data) { for(Map.Entry<Address,Connection> entry: conns.entrySet()) { Connection conn=entry.getValue(); try { conn.send(data.duplicate()); } catch(Throwable ex) { Address dest=entry.getKey(); removeConnectionIfPresent(dest, conn); log.error("failed sending data to %s: %s", dest, ex); } } }
protected void sendToAll(byte[] data, int offset, int length) { for(Map.Entry<Address,Connection> entry: conns.entrySet()) { Connection conn=entry.getValue(); try { conn.send(data, offset, length); } catch(Throwable ex) { Address dest=entry.getKey(); removeConnectionIfPresent(dest, conn); log.error("failed sending data to %s: %s", dest, ex); } } }
public void send(Address dest, byte[] data, int offset, int length) throws Exception { if(!validateArgs(dest, data)) return; if(dest == null) { sendToAll(data, offset, length); return; } if(dest.equals(local_addr)) { receive(dest, data, offset, length); return; } // Get a connection (or create one if not yet existent) and send the data Connection conn=null; try { conn=getConnection(dest); conn.send(data, offset, length); } catch(Exception ex) { removeConnectionIfPresent(dest, conn); throw ex; } }
public void send(Address dest, ByteBuffer data) throws Exception { if(!validateArgs(dest, data)) return; if(dest == null) { sendToAll(data); return; } if(dest.equals(local_addr)) { receive(dest, data); return; } // Get a connection (or create one if not yet existent) and send the data Connection conn=null; try { conn=getConnection(dest); conn.send(data); } catch(Exception ex) { removeConnectionIfPresent(dest, conn); throw ex; } }