Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.protocols.tcp-ip    |    TCP and IP network protocols.    |    14,669 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 13,454 of 14,669    |
|    Jorgen Grahn to lancer6238@yahoo.com    |
|    Re: Stopping pcap_loop and return to mai    |
|    04 Mar 10 11:46:24    |
      f726ce47       From: grahn+nntp@snipabacken.se              On Thu, 2010-03-04, lancer6238@yahoo.com wrote:       > Also, is it possible to set a duration for when packets would be       > captured? Something like:       >       > if (time(NULL) - start_time > 100)       > pcap_breakloop(handle);       >       > But I don't know where to put this, because so far all the example       > I've seen used pcap_breakloop in a signal handler, which requires user       > intervention. How will the time condition be checked while pcap_loop       > is running?              All the examples maybe, but you can surely call pcap_breakloop() from       your pcap_loop callback. It is clearly documented in the pcap(3)       manual page -- I hope you have read that?              (The man page talks a lot about using it in signal handlers, but       that's just because it's a trickier case.)              /Jorgen              --        // Jorgen Grahn |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca