private void send(final ICMPv6Socket socket, final DatagramPacket packet) throws IOException { try { socket.send(packet); } catch(final IOException e) { if (e.getMessage().matches("sendto error \\(65, .*\\)")) { throw new NoRouteToHostException("No Route to Host " + m_id.getAddress() + ": " + e.getMessage()); } else if (e.getMessage().matches("sendto error \\(64, .*\\)")) { throw new HostIsDownException("Host " + m_id.getAddress() + " is down: " + e.getMessage()); } else { throw e; } } }
private void send(IcmpSocket icmpSocket, DatagramPacket packet) throws IOException { try { icmpSocket.send(packet); } catch(IOException e) { if (e.getMessage().matches("sendto error \\(65, .*\\)")) { throw new NoRouteToHostException("No Route to Host " + m_id.getAddress() + ": " + e.getMessage()); } else if (e.getMessage().matches("sendto error \\(64, .*\\)")) { throw new HostIsDownException("Host " + m_id.getAddress() + " is down: " + e.getMessage()); } else { throw e; } } }
private void send(final ICMPv6Socket socket, final DatagramPacket packet) throws IOException { try { socket.send(packet); } catch(final IOException e) { if (e.getMessage().matches("sendto error \\(65, .*\\)")) { throw new NoRouteToHostException("No Route to Host " + m_id.getAddress() + ": " + e.getMessage()); } else if (e.getMessage().matches("sendto error \\(64, .*\\)")) { throw new HostIsDownException("Host " + m_id.getAddress() + " is down: " + e.getMessage()); } else { throw e; } } }