RE: [Libevent-users] Closing bufferevents sockets from the server side

2010-11-25 Thread Kelly Brock
Oh, should mention that depending on what you are trying to do in detail, you may not want to use bufferevent_free and instead use "shutdown" calls. I.e. the "correct" way to close a socket (buffer event) is basically the following (sorry if I'm stating the obvious): 1. Server writes the las

RE: [Libevent-users] Closing bufferevents sockets from the server side

2010-11-25 Thread Kelly Brock
Hi, > Hey, > I understand Simon's view on how not to close buffer event sockets, but > can some one explain why thishttps://gist.github.com/714606idea is bad? I don't feel "strongly" that this is incorrect; Simon may have more information on this. But, basically it is just added overhea

Fwd: [Libevent-users] Closing bufferevents sockets from the server side

2010-11-25 Thread Sid
Hey, I understand Simon's view on how not to close buffer event sockets, but can some one explain why this https://gist.github.com/714606 idea is bad? -- Forwarded message -- From: Sid Date: Wed, Nov 24, 2010 at 4:10 PM Subject: Re: [Libevent-users] Closing bufferevents so

Re: [Libevent-users] Closing bufferevents sockets from the server side

2010-11-24 Thread Simon Perreault
On 2010-11-24 15:54, Sid wrote: > Well water marks seem to be the way to go.. But before your reply came I > saw that in the library there is an interface > > *struct* evbuffer_cb_info { > size_t orig_size; > size_t n_added; > size_t n_deleted; > }; > > *typedef* *void* (

Re: [Libevent-users] Closing bufferevents sockets from the server side

2010-11-24 Thread Sid
Well water marks seem to be the way to go.. But before your reply came I saw that in the library there is an interface *struct* evbuffer_cb_info { size_t orig_size; size_t n_added; size_t n_deleted; }; *typedef* *void* (*evbuffer_cb_func)(*struct* evbuffer *buffer, *con

RE: [Libevent-users] Closing bufferevents sockets from the server side

2010-11-24 Thread Kelly Brock
Hi Sid, > Sorry that got posted by mistake in the wrong thread... here it is > again... > > > Hi, > I am using libevent 2.03 alpha 1 to create an app > . The app structure is as follows: > > A C++ app wraps lib event to listen on a domain socke

[Libevent-users] Closing bufferevents sockets from the server side

2010-11-23 Thread Sid
Sorry that got posted by mistake in the wrong thread... here it is again... Hi, > I am using libevent 2.03 alpha 1 to create an > app. > The app structure is as follows: > > A C++ app wraps lib event to listen on a domain socket. I use buffered > events. As you can