Examples of loop()


Examples of org.jnetpcap.Pcap.loop()

    for (int i = 0; i < COUNT; i++) {
      for (final String fname : files) {
        Pcap pcap = Pcap.openOffline(DIR.toString() + "/" + fname, errbuf);
        assertNotNull(errbuf.toString(), pcap);

        pcap.loop(Pcap.LOOP_INFINATE, new JBufferHandler<Pcap>() {

          public void nextPacket(PcapHeader header, JBuffer buffer, Pcap user) {
            count++;
            b += buffer.size();
          }
View Full Code Here

Examples of org.jnetpcap.Pcap.loop()

    /***************************************************************************
     * Third, Enter our loop and count packets until we reach the index of the
     * packet we are looking for.
     **************************************************************************/
    try {
      pcap.loop(Pcap.LOOP_INFINATE, new JBufferHandler<Pcap>() {
        int i = 0;

        public void nextPacket(PcapHeader header, JBuffer buffer, Pcap pcap) {

          /*********************************************************************
 
View Full Code Here

Examples of org.jnetpcap.Pcap.loop()

        try {
          barrier.exchange(null);
        } catch (InterruptedException e1) {
        }

        this.result = pcap.loop(end - start, new PcapPacketHandler<Pcap>() {
          int i = 0;

          public void nextPacket(PcapPacket packet, Pcap pcap) {

            assertNotNull(packet);
View Full Code Here

Examples of org.jnetpcap.Pcap.loop()

    for (final String fname : files) {
      Pcap pcap = Pcap.openOffline(fname, errbuf);
      assertNotNull(errbuf.toString(), pcap);

      try {
        pcap.loop(Pcap.LOOP_INFINATE, new JBufferHandler<String>() {
          private final int index = 1;

          public void nextPacket(PcapHeader header, JBuffer buffer, String fname) {
            buf.append(header, buffer);
          }
View Full Code Here

Examples of org.jnetpcap.Pcap.loop()

            errbuf);
    if (pcap == null) {
      throw new IllegalArgumentException(errbuf.toString());
    }

    pcap.loop((int) count, handler, pcap);
  }

  /**
   * Open offline.
   *
 
View Full Code Here

Examples of org.jnetpcap.Pcap.loop()

      }

      pcap.setFilter(program);
    }

    pcap.loop(Pcap.LOOP_INFINATE, handler, pcap);

    pcap.close();
  }

  /**
 
View Full Code Here

Examples of org.jnetpcap.Pcap.loop()

      for (final String fname : files) {
        Pcap pcap = Pcap.openOffline(DIR.toString() + "/" + fname, errbuf);
        assertNotNull(errbuf.toString(), pcap);

        pcap.loop(Pcap.LOOP_INFINATE, new JPacketHandler<Pcap>() {

          public void nextPacket(JPacket packet, Pcap user) {
            assertNotNull(packet);

            count++;
View Full Code Here

Examples of org.jnetpcap.Pcap.loop()

    for (int i = 0; i < COUNT / 10; i++) {
      for (String fname : files) {
        Pcap pcap = Pcap.openOffline(DIR.toString() + "/" + fname, errbuf);
        assertNotNull(errbuf.toString(), pcap);

        pcap.loop(Pcap.LOOP_INFINATE, new PcapPacketHandler<Pcap>() {

          public void nextPacket(PcapPacket packet, Pcap user) {
            assertNotNull(packet);

          }
View Full Code Here

Examples of org.jnetpcap.Pcap.loop()

    for (int i = 0; i < COUNT; i++) {
      for (final String fname : files) {
        Pcap pcap = Pcap.openOffline(DIR.toString() + "/" + fname, errbuf);
        assertNotNull(errbuf.toString(), pcap);

        pcap.loop(Pcap.LOOP_INFINATE, new JBufferHandler<Pcap>() {

          public void nextPacket(PcapHeader header, JBuffer buffer, Pcap user) {
            count++;
            b += buffer.size();
View Full Code Here

Examples of org.jnetpcap.winpcap.WinPcap.loop()

    final WinPcap pcap =
        WinPcap.openLive(alldevs.get(0).getName(), 65 * 1024, 1, 0, errbuf);
    pcap.setMinToCopy(0);

    pcap.loop(0, callback, pcap);

    return pcap;
  }

  /**
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.