Question

I am using netlink socket to communicate between user space application and a kernel module. However I want to stop routing data from kernel to the user app when the user app closes. Is there a way to get an event in kernel, when a process using netlink socket terminates ?

Was it helpful?

Solution

I take it that the app is closing normally?

If I were doing this, I would have the app send a message through the netlink socket back at the kernel module telling it to stop sending data when the user application receives the signal to terminate. (SIGTERM signal or closewindow events)

The sockets are bidirectional, so why not talk both ways?

Someone else might know a real answer to knowing when a process terminates, but it would be cleaner in my opinion not to hack it out like that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top