Re: [Libevent-users] Linking with -levent

2012-05-23 Thread William Ahern
On Tue, May 22, 2012 at 09:22:46AM -0400, Nick Mathewson wrote: > On Tue, May 22, 2012 at 2:40 AM, Ross Lagerwall > wrote: > > Hi, > > > > Linking with '-levent' is deprecated. Perhaps with libevent 2.1, it's time > > for it to be removed? (the pkgconfig stuff will have to be updated as per > > h

Re: [Libevent-users] exceptfds

2012-04-11 Thread William Ahern
On Wed, Apr 11, 2012 at 12:18:51PM +0200, Florian Lohoff wrote: > > Hi, > > is there a reason libevent has no way to feed in exceptfds? > > I have a little project for a couple of years with DVB Streaming and certain > ioctls for linux DVB drivers require the fds to be polled for exceptions. Up

Re: [Libevent-users] a dead looping bug when changing system time backward

2012-04-10 Thread William Ahern
On Wed, Apr 11, 2012 at 02:21:13AM +0300, Nir Soffer wrote: > Forward jumps should simply skip events in the past. It is just like > events skipped because the event loop was blocked. > > If you should run every 5 seconds, but woke up 21 seconds late, you > cannot fix the past - you just miss

Re: [Libevent-users] a dead looping bug when changing system time backward

2012-04-09 Thread William Ahern
On Tue, Apr 10, 2012 at 11:44:39AM +0800, 卓宜黄 wrote: > Hi all, > > I found an issue that it will trigger the timer callback dramatically > like a dead looping when moving the system time backward for a year > and then moving it forward to the accurate time. AFAICT, the libevent 2.x code uses cloc

Re: [Libevent-users] single vs multiple epoll event loop

2012-03-19 Thread William Ahern
On Mon, Mar 19, 2012 at 09:21:32PM +0530, Jim Boykin wrote: > I am designing a server to handle over 5-10 simultaneous > connection. Currently I am using single epoll in edge trigger mode for > all the connections. All is well till 50-100 connections, however > after 50-100 connections I d

Re: [Libevent-users] Asynchronous writes in the event loop model

2012-02-06 Thread William Ahern
On Mon, Feb 06, 2012 at 01:46:59PM -0800, Adrian Chadd wrote: > Hi, > > the standard trick: > > * designate one thread as "signals here" and block signals on all other > threads; > * use pipes for sending signals between threads (ie, to wake them up); > * wish that kqueue and similar methods wer

Re: [Libevent-users] avoiding file descriptor collisions

2011-12-09 Thread William Ahern
On Fri, Dec 09, 2011 at 07:21:44AM -0800, Myk Taylor wrote: > Hi all, > > I've run into another bit of trouble, but I don't see an easy way out > this time. The http(s) client I'm writing has many connections going up > and down continuously, and I'm running into what seem to be file > descrip

Re: [Libevent-users] Different behavior of my code

2011-09-08 Thread William Ahern
On Thu, Sep 08, 2011 at 04:44:26PM +0100, Nicholas Marriott wrote: > It is a limitation of OS X. Every other platform with kqueue(2) and all > I am aware of with poll(2) support it on all file descriptors. OS X > doesn't support it on anything other than sockets - so not on ttys, not > on files, n

Re: [Libevent-users] Different behavior of my code

2011-09-08 Thread William Ahern
On Thu, Sep 08, 2011 at 09:40:02AM -0700, Scott Lamb wrote: > Going back to Bernd Schoeller's original question: if "in.dat" and > "out.dat" are regular files, there's nothing useful libevent can do in > this program. If you just want to try out libevent, I'd suggest > playing with sockets instead

Re: [Libevent-users] mysql client with libevent

2011-08-31 Thread William Ahern
On Wed, Aug 31, 2011 at 09:10:35PM -0500, Nulik Nol wrote: > I have searched quickly what database engine supports asynchronous io > and found quite a lot of good projects, one of them called Redis, it > is a sort of replacement for memcachedb. Nice stuff! Check it out: > http://redis.io/ > > I th

Re: [Libevent-users] mysql client with libevent

2011-08-31 Thread William Ahern
On Wed, Aug 31, 2011 at 11:58:32AM -0500, Nulik Nol wrote: > Hi, > I was wondering if someone has managed it to adapt mysql client's C > API to work asynchronously ? > As far as I have checked, MySQL (5.6.2) uses libevent for server, but > not for the client. The only way to achieve sort of asynchr

Re: [Libevent-users] [libevent-usr] When is a [regular file descriptor] readable or writable?

2011-08-03 Thread William Ahern
On Wed, Aug 03, 2011 at 03:39:34PM +0800, zhihua che wrote: > Hi, everyone, > > I'm reading libevent-2.0 code and have made certain progress:). However, > I'm still confused with some basic concepts like "ready" for reading or > writing. In the context of sockets, I think I can imagine this "r

Re: [Libevent-users] Strange timeout scheduling in 1.4

2011-07-27 Thread William Ahern
On Wed, Jul 27, 2011 at 11:00:45PM -0400, Nick Mathewson wrote: > On Wed, Jul 27, 2011 at 10:35 PM, William Ahern > wrote: > > If you happen to know, is it the same story with clock_gettime() > performance? I ask because Libevent uses that function in preference > to gettim

Re: [Libevent-users] Strange timeout scheduling in 1.4

2011-07-27 Thread William Ahern
On Wed, Jul 27, 2011 at 07:03:33PM -0700, William Ahern wrote: > However, the difference between vDSO support and no vDSO support was nothing > compared to the OpenBSD v. Linux differences. OpenBSD system calls are > incredibly slow compared to Linux. A million gettimeofday calls o

Re: [Libevent-users] Strange timeout scheduling in 1.4

2011-07-27 Thread William Ahern
On Wed, Jul 27, 2011 at 10:10:36PM +0100, Nicholas Marriott wrote: > On Wed, Jul 27, 2011 at 01:10:05PM -0700, William Ahern wrote: > > Has anyone tested the performance gain of caching? Linux's gettimeofday() > > doesn't trap into the kernel; it effectively just reads

Re: [Libevent-users] Strange timeout scheduling in 1.4

2011-07-27 Thread William Ahern
On Wed, Jul 27, 2011 at 02:49:26PM -0400, Nick Mathewson wrote: > So because I'm at a conference this week, I can't examine the code too > closely. But my guess is that this is happening because Libevent > caches its calls to gettimeofday()/clock_gettime() during its event > loop, so that your ev

Re: [Libevent-users] detected a bad network connection for a TCP connection

2011-02-08 Thread William Ahern
On Tue, Feb 08, 2011 at 02:08:39PM -0500, Nick Mathewson wrote: > On Mon, Feb 7, 2011 at 5:15 PM, Ivan Novick wrote: > > Do you know how I can detect the disconnection caused by bringing down > > the interface on the server ... while still using libevent? > > If there's a good way to do this, Li

Re: [Libevent-users] Adding ipv6 support.

2011-02-07 Thread William Ahern
On Mon, Feb 07, 2011 at 12:47:03PM -0800, William Ahern wrote: > On Mon, Feb 07, 2011 at 02:40:03PM -0500, Simon Perreault wrote: > > On 2011-02-07 14:09, William Ahern wrote: > > >> Furthermore, you're ignoring alignment issues. > > > > > > There are

Re: [Libevent-users] Adding ipv6 support.

2011-02-07 Thread William Ahern
On Mon, Feb 07, 2011 at 02:40:03PM -0500, Simon Perreault wrote: > On 2011-02-07 14:09, William Ahern wrote: > >> Furthermore, you're ignoring alignment issues. > > > > There are no alignment issues here, arguably not even if we're talking pure > > standar

Re: [Libevent-users] Adding ipv6 support.

2011-02-07 Thread William Ahern
On Mon, Feb 07, 2011 at 01:02:42PM -0500, Simon Perreault wrote: > On 2011-02-07 12:53, Dave Hart wrote: > > If you only care about IPv4 and IPv6 sockets, consider using a union > > of the useful types: > > > > typedef struct union_saddr_tag { > > struct sockaddrsa; > > struct

Re: [Libevent-users] libevent with non standard ssl directory

2010-12-07 Thread William Ahern
On Tue, Dec 07, 2010 at 03:56:44PM -0700, Kevin Bowling wrote: > On Tue, Dec 7, 2010 at 2:07 PM, William Ahern > wrote: > > That means that the pkg-config in one tree has no idea about the pkg-config > > config in the other trees. I have to hack every dumb package that relies

Re: [Libevent-users] libevent with non standard ssl directory

2010-12-07 Thread William Ahern
On Tue, Dec 07, 2010 at 02:03:18PM -0500, Nick Mathewson wrote: > On Mon, Dec 6, 2010 at 6:53 PM, Sanjeev Kulkarni > wrote: > > Hey guys, > > I'm a relative newbee to libevent so apologies if this is already answered. > > How to configure libevent to use a non-standard installation path of > > op

Re: [Libevent-users] Read failures on Unix socket

2010-11-02 Thread William Ahern
On Tue, Nov 02, 2010 at 03:13:02PM -0400, Simon Perreault wrote: > On 2010-11-02 14:56, Gilad Benjamini wrote: > > - Open a Unix socket > > - Bind to a socket in the file system > > - Add an event with EV_READ and EV_PERSIST > > - Wait for events > > - When an event arrives, call recvfrom on the so

Re: [Libevent-users] Crash in event_del

2010-08-11 Thread William Ahern
On Wed, Aug 11, 2010 at 12:00:09PM -0700, Gilad Benjamini wrote: > My code currently runs with libevent 1.4 > While in the process of upgrading to libevent 2.0.6 I got a segfault. > > Code sample is pretty basic > event_set(&ev,fd,EV_READ,fd_handler,NULL) ; > event_del(&ev) ; > > The reason f

Re: [Libevent-users] event_add fails with ENOENT when on epoll

2010-04-20 Thread William Ahern
On Tue, Apr 20, 2010 at 01:20:21PM -0400, Nick Mathewson wrote: > On Mon, Apr 19, 2010 at 11:24 PM, Denis Bilenko > wrote: > > Hi, > > > > I've run into an issue where event_add() fails with ENOENT. > > This happens when a socket reuses a descriptor that was recently > > closed and was used befor

[Libevent-users] Valgrind patch

2009-11-27 Thread William Ahern
Valgrind complains on startup because kq_init passes to kevent only a partially initialized structure. The code doesn't expect kevent to look at .fflags, .udata, or .data, I suppose, because it merely tickles the kernel looking for an error response. But perhaps that's unwarranted chuminess (notwit