I'm writing an application using epoll and large amount of fd's. in order to improve the searches of fd to application relevant DB, I want to pass to epoll application info, such as index in DB array. I thought of using the data->ptr (epoll_data_t --> *ptr), as far as I understood, I can give pointer that holds the fd and private information from the application layer, but couldn't found any documents or examples.
I found this post, which seems to be relevant, but there is no implementation example... How to use epoll_event data.ptr
Thanks
You can put whatever you want in data
. It's not used by epoll itself, it just returns it when the event occurs on the fd specified in the argument list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With