socketry / nio4r

Cross-platform asynchronous I/O primitives for scalable network clients and servers.
Other
965 stars 86 forks source link

Watching other events except in/out when using epoll backend? #230

Closed senid231 closed 3 years ago

senid231 commented 4 years ago

Hello. I'm currently working on senid231/libvirt_async - async implementation of libvirt event api. I've interested is it possible to wait for ERR and HUP events in async reactor? It's needed because libvirt uses this events.

ioquatix commented 4 years ago

What is ERR?

Do you mean HUP signal?

senid231 commented 4 years ago

EPOLLERR - it's when there is an error occured in fd

ioquatix commented 4 years ago

To get errors, you wait until it's readable and then read to get the error. You can use MSG_PEEK in some cases to avoid removing data from the buffer.