How to use pcap_breakloop?

后端 未结 1 646
不知归路
不知归路 2021-01-14 03:57

I have a pcap_loop function in another function, that captures packets until the user stops it, i.e.

void functionA()
{
   signal(SIGINT, terminate_process);         


        
相关标签:
1条回答
  • 2021-01-14 04:25

    You can use alarm to generate a signal after a given number of seconds:

    void functionA()
    {
        signal(SIGALRM, terminate_process); 
        alarm(100);
    }
    
    0 讨论(0)
提交回复
热议问题