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 775115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:14:18+00:00 2026-05-14T19:14:18+00:00

These two functions are both infinite loops, and the programe hangs once called in

  • 0

These two functions are both infinite loops,

and the programe hangs once called in the same thread.

gtk_main(); 
...
pcap_loop(adhandle, 0, packet_handler, NULL);

When I click the “start” button,I want pcap to start working;And if I press the “stop” button,pcap stop.

How do I create a child thread and run pcap_loop(adhandle, 0, packet_handler, NULL); instead?

  • 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-14T19:14:18+00:00Added an answer on May 14, 2026 at 7:14 pm

    Unless I am missing something, your problem is that both GTK+ and
    libpcap are organized around events fired from a main loop. Without
    looking through the documentation, I don’t know about GTK+, but there
    is another mode of operation for libpcap: You can use pcap_next() or
    pcap_next_ex() without giving up control over your program flow.

    It should be possible to register a function that periodically calls
    one of these two functions using g_timeout_add() or g_idle_add(),
    removing the need to mess around with threads and mutex mechanisms
    altogether.

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

Sidebar

Related Questions

I want these two print functions to do the same thing: unsigned int Arraye[]
Currently i'm having trouble using two functions in my -(void)viewDidLoad , both of these
I know that both of these two functions work with multiple points on my
So do these two functions accomplish the same thing in C++? void MYCLASS::clear() {
Consider these two C functions with different headers but the same body differing only
How can I combine these two functions so that they both work? Right now,
I am using these two functions in order to rotate my objects in my
I have these two functions (with Point2D & LineVector (has 2 Point2D member variables)
Are there any PHP equivalents for these two functions? I tried searching but couldn't
What is the difference between these two functions? 1: $(document).ready(function myfunc() { function dosomething()

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.