-
Notifications
You must be signed in to change notification settings - Fork 101
Closed
Description
Hi! Here is my code.
self.out_nfqueue = netfilterqueue.NetfilterQueue()
self.out_nfqueue.bind(self.out_queue_num,self.out_callback)
self.out_nfqueue_socket = socket.fromfd(self.out_nfqueue.get_fd(),socket.AF_UNIX,socket.SOCK_STREAM)
...
# when I finish
self.out_nfqueue.unbind()
self.out_nfqueue_socket.close()
In line 1, Class NetfilterQueue will create a FileDescriptor in /proc/fd/ . But when I finish these code. this socket will not be released and still in /proc/fd/ . However the FileDescriptor created in line 3 will be released in line 7 nicely.
I need to call the above code many times. I discovered that the FileDescriptor created in line 1 can not be released correctly, which lead to crashes of opening too many filedescriptors ( filedescriptor out of range in select() ).
So how should I solve this problem? Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels