On my dev system, when terminating the managing node via Ctrl+C, the managing node was stuck in pcap_loop(). The shutdown-thread does call pcap_break(), however according to the libpcap-documentation this is not enough to terminate another thread (it simply sets a flag):
Note also that, in a multi-threaded application, if one thread is blocked in pcap_dispatch(), pcap_loop(), pcap_next(), or pcap_next_ex(), a call to pcap_breakloop() in a different thread will not unblock that thread; you will need to use whatever mechanism the OS provides for breaking a thread out of blocking calls in order to unblock the thread, such as thread cancellation in systems that support POSIX threads.
I plan to contribute a fix for this issue.
Best regards, Clemens
Last edit: Clemens Eisserer 2017-02-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
On my dev system, when terminating the managing node via Ctrl+C, the managing node was stuck in pcap_loop(). The shutdown-thread does call pcap_break(), however according to the libpcap-documentation this is not enough to terminate another thread (it simply sets a flag):
I plan to contribute a fix for this issue.
Best regards, Clemens
Last edit: Clemens Eisserer 2017-02-27
Hi Clemens,
Thanks for this information and your suggestion!
Our preferred way of including code into the stack is via PullRequests on GitHub:
https://github.com/OpenAutomationTechnologies/openPOWERLINK_V2/pulls
Going this way, you'll also officially show up in the repository history :-)
Best regards,
Wolfgang
Thanks for clarification, I've just created the pull request.