Re: [Libevent-users] Adding ipv6 support.

2011-02-08 Thread Simon Perreault
On 2011-02-08 00:33, William Ahern wrote: > getaddrinfo()/getnameinfo() are definitely more abstract than their > predecessor interfaces, but they're not abstract enough. Rather than presume > IPv4, they basically presume TCP. What do you mean? I've been using them with UDP without any issues...

Re: [Libevent-users] Adding ipv6 support.

2011-02-07 Thread Simon Perreault
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 > standard C. Certainly not in any implementation that supports the BSD > sockets API and the .sa_family member overlay. It s

Re: [Libevent-users] Adding ipv6 support.

2011-02-07 Thread Simon Perreault
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 sockaddr_in sin; > struct sockaddr_in6 sin6; > } union_saddr; >

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] Read failures on Unix socket

2010-11-02 Thread Simon Perreault
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 socket waiting for a fixed > size of ~1800 bytes Aren't you supposed to listen

Re: [Libevent-users] Stop listening on http server when accept() returns Too Many Open Files

2010-09-21 Thread Simon Perreault
On 2010-09-21 08:15, W.C.A. Wijngaards wrote: > Perhaps you can get EPIPE "Broken Pipe" more easily; fork then kill that > process involved in the pipe, that sort of thing. I don't see EPIPE in the list of possible error codes for accept()... But it's true that other errors would be easier to tri

Re: [Libevent-users] Stop listening on http server when accept() returns Too Many Open Files

2010-09-21 Thread Simon Perreault
f7d4d133c5f220b639ff Mon Sep 17 00:00:00 2001 From: Simon Perreault Date: Mon, 20 Sep 2010 12:47:39 -0400 Subject: [PATCH] Add error callback to evconnlistener --- include/event2/listener.h | 12 listener.c| 12 +++- 2 files changed, 23 insertions(+)

Re: [Libevent-users] Stop listening on http server when accept() returns Too Many Open Files

2010-09-20 Thread Simon Perreault
On 2010-09-20 13:53, Nick Mathewson wrote: >> Would the attached patch work? > > Looks okay to me. Probably, you'd want to rename "ecb" to "errorcb" > or something; we don't use "ecb" to mean "error callback" anywhere > else. Sure, no problem. Also, I noticed a small typo: -void evconnlistner_

Re: [Libevent-users] Stop listening on http server when accept() returns Too Many Open Files

2010-09-20 Thread Simon Perreault
iagenie.ca STUN/TURN server--> http://numb.viagenie.ca vCard 4.0 --> http://www.vcarddav.org >From 0a5e1a39692dad552b08f7d4d133c5f220b639ff Mon Sep 17 00:00:00 2001 From: Simon Perreault Date: Mon, 20 Sep 2010 12:47:39 -0400 Subject: [PATCH] Add error callback to e

Re: [Libevent-users] Stop listening on http server when accept() returns Too Many Open Files

2010-09-20 Thread Simon Perreault
Does anyone have an answer to that? We just hit this problem in real life. It's not just theory. Thanks, Simon On 2010-09-03 03:49, Yee Keat Phuah wrote: > Hi, > > I am using the http server part of libevent 2.0.6, and currently testing > it under all sorts of situation. One of the situation I r

Re: [Libevent-users] bufferevent_setwatermark() enables reading

2010-09-09 Thread Simon Perreault
On 2010-09-09 17:28, Simon Perreault wrote: > Would this be the right fix? Argh, git-send-email didn't do what I wanted it to do. Here's the patch in attachment. Sorry. Simon -- NAT64/DNS64 open-source --> http://ecdysis.viagenie.ca STUN/TURN server--> http://numb.vi

Re: [Libevent-users] bufferevent_setwatermark() enables reading

2010-09-09 Thread Simon Perreault
Would this be the right fix? *** To unsubscribe, send an e-mail to majord...@freehaven.net with unsubscribe libevent-usersin the body.

[Libevent-users] bufferevent_setwatermark() enables reading

2010-09-09 Thread Simon Perreault
Hello, I do this: bufev = bufferevent_socket_new(...); bufferevent_setcb(bufev, foo, ...); bufferevent_setwatermark(bufev, EV_READ, ...); When input exceeding the read watermark is received, foo() is called even though I did not call bufferevent_enable(bufev, EV_READ). Why is this? Inside foo(

Re: [Libevent-users] Stop listening on http server when accept() returns Too Many Open Files

2010-09-03 Thread Simon Perreault
On 2010-09-03 03:49, Yee Keat Phuah wrote: > I am using the http server part of libevent 2.0.6, and currently testing > it under all sorts of situation. One of the situation I ran into is when > there are too many connections, there might be "Too Many Open Files" > returned from the accept() call,