0

I have been building a multi threaded server, with each thread having a single epoll fd to manage incoming tcp connections. For inter thread communication I used unix domain sockets with the intention of leveraging the existing per thread epoll.

But it seems that, Epoll stops returning network socket events if the unix domain socket is also added.

My question is can one Epoll instance be used to track events on both tcp sockets and unix domain sockets? Is this the expected behaviour? I didn't come across any literature suggesting so. Or do I need to have a separate Epoll instances to track these two different types of sockets?

Eimantas
  • 48,927
  • 17
  • 132
  • 168
aunindo
  • 133
  • 2
  • 9
  • IMHO *any* filedescriptor could be selected, polled or epolled. For disk-files this is rather useless (they always select readable + writable). But *network* sockets and unix-domain sockets are equivalent wrt select/poll/epoll. – wildplasser Jun 09 '12 at 13:08

1 Answers1

1

epoll, poll and select were designed to monitor multiple file descriptors. It doesn't limit of monitoring only one instance of file / socket descriptors at any time.

is can one Epoll instance be used to track events on both tcp sockets and unix domain sockets? Yes, there is no specific limit on using epoll.

Have a look of sample epoll program at Could you recommend some guides about Epoll on Linux

Community
  • 1
  • 1
Viswesn
  • 4,674
  • 2
  • 28
  • 45