[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] Multiplexing protocol using libevent



Hi,

I'm trying to write multiplexing protocol. Data has to be read from many prioritized buffers (which will be fed by many different threads), sent as a one UDP stream via Network, and then written to many different buffers(regarding info from the header).
To be precise here's an image: http://img861.imageshack.us/i/protocol.png/

Number of buffers can be relatively big (even tens of thousands), but most of them will not be used (at least not in the same time). So I need to invoke sender, when data arrives to any of these buffers. That's the point when I wanted to use libevent. As far as I know to achieve this I need to create pipe for every buffer, but I'm afraid it is not the most efficient way (especially with such number of pipes). Is there any better way to invoke sender?

I need also to do something opposite on the other side of the network (one receiver dispatching header, writing to appropriate buffer which will invoke appropriate function, but I think solution is the same here.

Anyone has an idea how to efficiently solve this problem?

Thanks in advance
Michal