Skip to content
Advertisement

Tag: epoll

chaining multiple epoll instances

Can we add file descriptor returned by epoll_create to another epoll instance using epoll_ctl. how do we chain multiple epoll instances in the application, lets say if we have 2 epoll instances one coming from the application and the other coming from library. Please advise. Answer From man epoll Q3 Is the epoll file descriptor itself poll/epoll/selectable? A3 Yes. If

meaning of EPOLLERR from epoll_wait with a pipe

This is similar to the question 1 but is about pipes. If epoll_wait returns EPOLLERR for the write end of a pipe, how do I distinguish a general error condition from the read end of the pipe been closed? For the sockets case the answer was to use “use getsockopt and SO_ERROR to get the pending error” and compare that

epoll: must I use multi-threading

I’ve got a basic knowledge from here about epoll. I know that epoll can monitor multiple FDs and handle them. My question is: can a heavy event block the server so I must use multithreading? For example, the epoll of a server is monitoring 2 sockets A and B. Now A starts to send lot of messages to the server

Linux: Recv randomly returns zero

I wrote a simple TCP network library with epoll for linux. In one of my tests, I want to test the throughput of the library. I send 2000000 msgs of 500 bytes. The binded socket randomly returns zero on a recv after 800000 or more msgs have been received. Other times, all messages are received. What would cause this to

Linux, C, epoll(), read() data incompleted?

Linux, C. Below issue only happens by using epoll(). If I use select() on server socket, there is no data loss. ============================= Update: I received errno =11 (Try again) in read(). Do I need to continue, or break the while loop? ============================= I have client side, send 1280 K data in 10 times (each time, I send 128K data); I

Epoll_wait returning events on closed file descriptor

I’m working with a multithreaded embedded application in which epoll is used for IO in one of the threads. I’m relying on a particular feature of epoll that specifies that closing a file descriptor automatically removes it from the epoll set (Question/Answer 6 in man 7 epoll). In this case, the file descriptor close is done in the same thread

Advertisement