[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Multiplexing protocol using libevent
- To: libevent-users@xxxxxxxx
- Subject: [Libevent-users] Multiplexing protocol using libevent
- From: Michał Król <mharnen@xxxxxxxxx>
- Date: Mon, 21 Mar 2011 11:09:09 +0100
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Mon, 21 Mar 2011 06:09:17 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=Mc5EQBKi2Nlvvl91twvKF1JPDiTjJVhRk+3UYXMOAlg=; b=vuBfggvieOvk5yZcA+sJ9NEo3sBHAR0BpD7eHfB5TZNYFsPv6rK7snseAgTwRtuB6A s0d44b5FwMzO00iag00Qh0hJlTTw61Jldk0/3HrpGE2K0y9GOMFc9lApE2WkHAptSZQC ppbOeE86J7h0JlaMrEJcqFJKGNSHb2T1RztJw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=bx7S6aAreWO3IS/AUx6NwXIw6X5CSEoZ9DYEoL6KkXh4l2XcKEM3e509jHpx7j43CD KnJhGbeyNGG/VovZhedGsLINAbpiFr61MBmea5ZAaqGRlczxsXtCQastG6kiwn3OMJ0M mH3RH5JUCu3lJ0hlep73NrkhEtdMTvpO9mwUg=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
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