epoll

Could you recommend some guides about Epoll on Linux

I need to know about Epoll On linux System. Could you recommend manual or guides about epoll library? need more detailed guides. it's better to have some examples. help me. and Thank you for reading. ...

What is the best epoll/kqueue/select equvalient on Windows?

What is Windows' best I/O event notification facility? By best I mean something that ... doesn't have a limit on number of input file descriptors works on all file descriptors (disk files, sockets, ...) provides various notification modes (edge triggered, limit triggered) ...

Boost Message Queue not based on POSIX message queue? Impossible to select(2)?!

I thought I'd use Boost.Interprocess's Message Queue in place of sockets for communication within one host. But after digging into it, it seems that this library for some reason eschews the POSIX message queue facility (which my Linux system supports), and instead is implemented on top of POSIX shared memory. The interface is similar e...

How epoll detect clientside close in Python?

...

Losing bytes on an epoll controlled non-blocking socket when the other side writes and closes

I've a non-blocking socket currently subscribed to: ev.events = EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP | EPOLLRDHUP| EPOLLET; It receives a couple of EPOLLINs which I read non-blocking till EAGAIN and then I receive HUP & RDHUP, sometimes with a few bytes more to read. The other side is just: send(socket,960_bytes_buffer) close(s...

Detect if connection has been established

Hello folks, I recently began learning network programming under Linux and it seems I can't figure out the right way to detect if a connection to remote host has been established. ATM all non-established connections are registered in a epoll instance. Once an event with the EPOLLOUT flag set to 1 arrives, the connection is marked as est...

How do you use AIO and epoll together in a single event loop?

How can you combine AIO and epoll together in a single event loop? Google finds lots of talk from 2002 and 2003 about unifying them, but its unclear if anything happened, or if it's possible. Has anyone rolled-their-own with an epoll loop using eventfd for the aio signal? ...

accept/epoll problem

I have this code that uses epoll and it has a problem. When I run it, it gives output: Server-socket() is OK... Server-bind() is OK... 3 4 accept: Invalid argument I'm running it on ubuntu linux, system updated, both as limited user and root what is wrong with the input to accept? What should I change? struct epoll_event ev, events[...

can the send function block

I'm writing a chat program and for the server, when I send data can the send() function take a long time to send out the data? Here is my problem: I'm using linux 2.6 with epoll, server in single thread If send() blocks, then this means all other activity on the server will stop. Like if there is a very slow client that does not send AC...

poll/epoll compatible Timer

Greetings, I was wondering if there is a way to use a timer in combination with linux poll/epoll API. I already use epoll and it would integrate very nice with the existing code if i could make the timer to be just another epoll event in my queue. A possible way is maybe, a file-based Timer, like echo 400;now > /dev/timer ; cat /dev/t...

Python epoll.register threadsafe?

Does anyone know if I can call epoll.register from another thread safely? Here is what I am imagining: Thread 1: epoll.poll() Thread 2: adding some fd to the same epoll object with epoll.register http://docs.python.org/library/select.html ...

epoll_data_t question (specifically about C data types)

The union epoll_data_t looks like: typedef union epoll_data { void *ptr; int fd; __uint32_t u32; __uint64_t u64; } epoll_data_t; This is more of a general C question, but why are the leading double underscores __uint{32,64} types used instead of just uint{32,64} without the underscores? I don't really underst...

epoll performance

Hi there... Can anyone please help me to answer the questions about epoll_wait. Is it overkill to use many threads that call epoll_wait on the same fds set to serve at about 100K active sockets? or will it just be enough to create only 1 thread to perform epoll_wait? How many threads will wake up from epoll_wait when for example only ...

What is the state of C10K-like event-based server development in TCL?

TCL is a nice simple programming language, but does not seem to get the credit and/or respect it deserves [1]. I learned it back in 1995 in college and promptly forgot about it only to stumble upon it again recently. I am mostly interested TCL for developing TCP-based network services as well as for web development. It has been ment...

revisiting "how do you use aio and epoll together"

following the discussion at http://stackoverflow.com/questions/1825621/how-do-you-use-aio-and-epoll-together-in-a-single-event-loop. There are in fact 2 "aio" APIs in linux. There's POSIX aio (the aio_* family of functions), included in glibc and libaio developed I believe by RedHat (?), the io_* family. The first one allows registrat...

Dealing with data on multiple TCP connections with epoll

I have an application that is going to work like a p2p-software where all peer are going to talk to each other. Since the communication will be TCP i thought that I could use epool(4) so that multiple connections can be handled. Since each peer will send data very often, I thought that I will establish a persistent connection to each pee...

EPIPE blocks server

I have written a single-threaded asynchronous server in C running on Linux: The socket is non-blocking and as for polling, I am using epoll. Benchmarks show that the server performs fine and according to Valgrind, there are no memory leaks or other problems. The only problem is that when a write() command is interrupted (because the cli...

serving large file using select, epoll or kqueue

Nginx uses epoll, or other multiplexing techniques(select) for its handling multiple clients, i.e it does not spawn a new thread for every request unlike apache. I tried to replicate the same in my own test program using select. I could accept connections from multiple client by creating a non-blocking socket and using select to decide ...

What is "urgent data"?

The man page of epoll_ctl() says about EPOLLPRI: There is urgent data available for read(2) operations. How exactly is "urgent data" defined and who decides which data has priority? ...

Socket Read In Multi-Threaded Application Returns Zero Bytes or EINTR (104)

Hi. Am a c-coder for a while now - neither a newbie nor an expert. Now, I have a certain daemoned application in C on a PPC Linux. I use PHP's socket_connect as a client to connect to this service locally. The server uses epoll for multiplexing connections via a Unix socket. A user submitted string is parsed for certain characters/words ...