public V6Pinger(int id) throws Exception { super(NativeDatagramSocket.create(NativeDatagramSocket.PF_INET6, NativeDatagramSocket.IPPROTO_ICMPV6, id)); // Windows requires at least one packet sent before a receive call can be made without error // so we send a packet here to make sure... This one should not match the normal ping requests // since it does not contain the cookie so it won't interface. if (Platform.isWindows()) { final ICMPv6EchoPacket packet = new ICMPv6EchoPacket(64); packet.setCode(0); packet.setType(Type.EchoRequest); packet.getContentBuffer().putLong(System.nanoTime()); packet.getContentBuffer().putLong(System.nanoTime()); getPingSocket().send(packet.toDatagramPacket(InetAddress.getByName("::1"))); } }
public V6Pinger(final int pingerId) throws Exception { super(pingerId, NativeDatagramSocket.create(NativeDatagramSocket.PF_INET6, NativeDatagramSocket.IPPROTO_ICMPV6, pingerId)); // Windows requires at least one packet sent before a receive call can be made without error // so we send a packet here to make sure... This one should not match the normal ping requests // since it does not contain the cookie so it won't interface. if (Platform.isWindows()) { final ICMPv6EchoPacket packet = new ICMPv6EchoPacket(64); packet.setCode(0); packet.setType(Type.EchoRequest); packet.getContentBuffer().putLong(System.nanoTime()); packet.getContentBuffer().putLong(System.nanoTime()); getPingSocket().send(packet.toDatagramPacket(InetAddress.getByName("::1"))); } }
public V4Pinger(final int pingerId) throws Exception { super(pingerId, NativeDatagramSocket.create(NativeDatagramSocket.PF_INET, NativeDatagramSocket.IPPROTO_ICMP, pingerId)); // Windows requires at least one packet sent before a receive call can be made without error // so we send a packet here to make sure... This one should not match the normal ping requests // since it does not contain the cookie so it won't interface. if (Platform.isWindows()) { final ICMPEchoPacket packet = new ICMPEchoPacket(64); packet.setCode(0); packet.setType(Type.EchoRequest); packet.getContentBuffer().putLong(System.nanoTime()); packet.getContentBuffer().putLong(System.nanoTime()); getPingSocket().send(packet.toDatagramPacket(InetAddress.getLocalHost())); } }
public V4Pinger(final int id) throws Exception { super(NativeDatagramSocket.create(NativeDatagramSocket.PF_INET, NativeDatagramSocket.IPPROTO_ICMP, id)); // Windows requires at least one packet sent before a receive call can be made without error // so we send a packet here to make sure... This one should not match the normal ping requests // since it does not contain the cookie so it won't interface. if (Platform.isWindows()) { final ICMPEchoPacket packet = new ICMPEchoPacket(64); packet.setCode(0); packet.setType(Type.EchoRequest); packet.getContentBuffer().putLong(System.nanoTime()); packet.getContentBuffer().putLong(System.nanoTime()); getPingSocket().send(packet.toDatagramPacket(InetAddress.getLocalHost())); } }
public V6Pinger(int id) throws Exception { super(NativeDatagramSocket.create(NativeDatagramSocket.PF_INET6, NativeDatagramSocket.IPPROTO_ICMPV6, id)); // Windows requires at least one packet sent before a receive call can be made without error // so we send a packet here to make sure... This one should not match the normal ping requests // since it does not contain the cookie so it won't interface. if (Platform.isWindows()) { final ICMPv6EchoPacket packet = new ICMPv6EchoPacket(64); packet.setCode(0); packet.setType(Type.EchoRequest); packet.getContentBuffer().putLong(System.nanoTime()); packet.getContentBuffer().putLong(System.nanoTime()); getPingSocket().send(packet.toDatagramPacket(InetAddress.getByName("::1"))); } }
public V4Pinger(final int id) throws Exception { super(NativeDatagramSocket.create(NativeDatagramSocket.PF_INET, NativeDatagramSocket.IPPROTO_ICMP, id)); // Windows requires at least one packet sent before a receive call can be made without error // so we send a packet here to make sure... This one should not match the normal ping requests // since it does not contain the cookie so it won't interface. if (Platform.isWindows()) { final ICMPEchoPacket packet = new ICMPEchoPacket(64); packet.setCode(0); packet.setType(Type.EchoRequest); packet.getContentBuffer().putLong(System.nanoTime()); packet.getContentBuffer().putLong(System.nanoTime()); getPingSocket().send(packet.toDatagramPacket(InetAddress.getLocalHost())); } }
public V6Pinger() throws Exception { super(NativeDatagramSocket.create(NativeDatagramSocket.PF_INET6, Platform.isMac() ? NativeDatagramSocket.SOCK_DGRAM : NativeDatagramSocket.SOCK_RAW, NativeDatagramSocket.IPPROTO_ICMPV6)); // Windows requires at least one packet sent before a receive call can be made without error // so we send a packet here to make sure... This one should not match the normal ping requests // since it does not contain the cookie so it won't interface. if (Platform.isWindows()) { ICMPv6EchoPacket packet = new ICMPv6EchoPacket(64); packet.setCode(0); packet.setType(Type.EchoRequest); packet.getContentBuffer().putLong(System.nanoTime()); packet.getContentBuffer().putLong(System.nanoTime()); getPingSocket().send(packet.toDatagramPacket(InetAddress.getByName("::1"))); } }
public void dump() throws Exception { NativeDatagramSocket m_pingSocket = NativeDatagramSocket.create(NativeDatagramSocket.PF_INET6, NativeDatagramSocket.IPPROTO_ICMPV6, 1234); if (Platform.isWindows()) { ICMPv6EchoPacket packet = new ICMPv6EchoPacket(64); packet.setCode(0); packet.setType(Type.EchoRequest); packet.getContentBuffer().putLong(System.nanoTime()); packet.getContentBuffer().putLong(System.nanoTime()); m_pingSocket.send(packet.toDatagramPacket(InetAddress.getByName("::1"))); } try { NativeDatagramPacket datagram = new NativeDatagramPacket(65535); while (true) { m_pingSocket.receive(datagram); System.err.println(datagram); } } catch(Throwable e) { e.printStackTrace(); } }
public void dump() throws Exception { NativeDatagramSocket m_pingSocket = NativeDatagramSocket.create(NativeDatagramSocket.PF_INET6, Platform.isMac() ? NativeDatagramSocket.SOCK_DGRAM : NativeDatagramSocket.SOCK_RAW, NativeDatagramSocket.IPPROTO_ICMPV6); if (Platform.isWindows()) { ICMPv6EchoPacket packet = new ICMPv6EchoPacket(64); packet.setCode(0); packet.setType(Type.EchoRequest); packet.getContentBuffer().putLong(System.nanoTime()); packet.getContentBuffer().putLong(System.nanoTime()); m_pingSocket.send(packet.toDatagramPacket(InetAddress.getByName("::1"))); } try { NativeDatagramPacket datagram = new NativeDatagramPacket(65535); while (true) { m_pingSocket.receive(datagram); System.err.println(datagram); } } catch(Throwable e) { e.printStackTrace(); } }
public V4Pinger() throws Exception { super(NativeDatagramSocket.create(NativeDatagramSocket.PF_INET, Platform.isMac() ? NativeDatagramSocket.SOCK_DGRAM : NativeDatagramSocket.SOCK_RAW, NativeDatagramSocket.IPPROTO_ICMP)); // Windows requires at least one packet sent before a receive call can be made without error // so we send a packet here to make sure... This one should not match the normal ping requests // since it does not contain the cookie so it won't interface. if (Platform.isWindows()) { ICMPEchoPacket packet = new ICMPEchoPacket(64); packet.setCode(0); packet.setType(Type.EchoRequest); packet.getContentBuffer().putLong(System.nanoTime()); packet.getContentBuffer().putLong(System.nanoTime()); getPingSocket().send(packet.toDatagramPacket(InetAddress.getLocalHost())); } }
public void dump() throws Exception { NativeDatagramSocket m_pingSocket = NativeDatagramSocket.create(NativeDatagramSocket.PF_INET6, NativeDatagramSocket.IPPROTO_ICMPV6, 1234); if (Platform.isWindows()) { ICMPv6EchoPacket packet = new ICMPv6EchoPacket(64); packet.setCode(0); packet.setType(Type.EchoRequest); packet.getContentBuffer().putLong(System.nanoTime()); packet.getContentBuffer().putLong(System.nanoTime()); m_pingSocket.send(packet.toDatagramPacket(InetAddress.getByName("::1"))); } try { NativeDatagramPacket datagram = new NativeDatagramPacket(65535); while (true) { m_pingSocket.receive(datagram); System.err.println(datagram); } } catch(Throwable e) { e.printStackTrace(); } }