[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] Send evbuffer to multiple clients
- To: libevent-users@xxxxxxxxxxxxx
- Subject: Re: [Libevent-users] Send evbuffer to multiple clients
- From: Nick Mathewson <nickm@xxxxxxxxxxxxx>
- Date: Mon, 6 Jun 2011 20:29:28 -0400
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Mon, 06 Jun 2011 20:29:36 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=jALnNag9eh0dxpTwiObGuQQhFsFT38eI7/fKQAoS9cQ=; b=gAFCRjrVrMog1Zrc83XL562MFe0D258anlFwXAeo3hE3ruAggD4TIbKqCp4PcYmLar ebRwZlfT0OVoqnjDnE3RrVRYD+l952KAd8N64wKZK/mw3l6OMtrx6MfvFkhtTt7FWtLl YOq8DEGFsB5OOiGrKtLJ5SAbVfo4Orsij2gPA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=GfnX0MP4elpNS9goYGytGY2Dk/3A7Jak4dYtHPKsrShh2wF+LDAN9yEogzg/smWXIU IjsSkKxvASHFGXk1IomTLy3T7PS+hQNeQVQhQji7Y5llx6CVPL5OHpcUltCrH1Q+CRyp R+Mj7De0rUYH3ao+ejpJxXV3tP1L3Zs3G39Us=
- In-reply-to: <4DE65A98.9040400@xxxxxxxxxxx>
- References: <4DE65A98.9040400@xxxxxxxxxxx>
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
On Wed, Jun 1, 2011 at 11:28 AM, Joachim Bauch <jojo@xxxxxxxxxxx> wrote:
> Hi,
>
> what is the best way to pass data from one evbuffer to multiple
> clients (i.e. other evbuffers)? There seems to be no direct way as
> the obvious "evbuffer_add_buffer" removes data from the source buffer.
>
> For now I use a combination of "evbuffer_pullup" and
> "evbuffer_add_reference" with my own reference counting of the
> source buffer, but probably there is a better way I'm not seeing
> right now.
Hm. If there's nothing hideously complex in the source buffer (that
is, nothing added with evbuffer_add_file), you could try an
appropriate combination of evbuffer_peek and evbuffer_add_reference.
Other than that, I'm not thinking of much.
I'd love to get a better API for this in 2.1, if anybody wants to write one.
--
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.