Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 553029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:33:44+00:00 2026-05-13T11:33:44+00:00

Using ruby 1.9 and latest gem install pcap + fix for compiling (convert ->ptr

  • 0

Using ruby 1.9 and latest gem install pcap + fix for compiling (convert ->ptr/->len to _PTR/_LEN), i found that after doing simple code:

require 'pcap'
cap = Pcap::Capture.open_offline('1.dmp')
cap.each { |pkt| p pkt.src; }

exit

Pcap gem not leaving block cap.each, i.e. output:

...
213.248.106.202
192.168.1.50
213.248.106.202
192.168.1.50

^C
^C
^C
^C
^C

And process can be killed only by kill -s KILL <process_id>.
Is there any way to fix this?

P.S. 1.dmp file generated using tcpdump -w 1.dmp.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:33:45+00:00Added an answer on May 13, 2026 at 11:33 am

    Pcap::Capture#each or Pcap::Capture#each_packet takes an optional count argument. If it is -1, it loops until EOF.

    You could try passing a number to each and see what happens.

    cap.each_packet(4) {|pkt|p pkt.src}
    

    If that hangs, there might be an issue in the extension code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Ruby 1.9.2 (Yarv). When I install gems I just use gem install
I'm using Rails 3.2.3 and Ruby 1.9.3 along with the latest version of gmaps4rails.
Using Ruby 1.8.7-p358, Rails 3.0.12, gem responder, gem simple-form; jquery_ujs.js I have a form
I've got two versions of ruby installed, the latest using RVM. How do I
I am able to install the json library using ruby gems. In case it's
Trying to parse and XLSX file using roo gem in a ruby script. In
Using ruby REE, what mysql libs do I need to install via aptitude install?
When trying to install the gem laser, I got an error that laser requires
I have tried several times to install rails. Using RVM, then compiling the source
Can I ask ruby or rubygems to use the latest gem regardless of its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.