1

My goal is to monitor traffic generated by a process. The approach that i was thinking of was to handle each socket create event for that process and based on that create a new rule in IPTables. Once the process terminates i can compute the data transferred by it.

I can find out all the open sockets of a process by using netstat but that results in poor performance as i have to poll netstat after fixed intervals, to check if any new socket has been opened by this process. I want to use some interrupt based mechanism.

Is there a way by which my application can get notified whenever a new socket is created in the system?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.