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 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 no alignment issues here, arguably not even if

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 > > standard C. Certainly not in any implementation t

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 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] Adding ipv6 support.

2011-02-07 Thread Evan Jones
On Feb 7, 2011, at 13:02 , Simon Perreault wrote: Furthermore, you're ignoring alignment issues. What potential alignment problem can occur with the union that Dave proposes? My understanding is that C compilers will ensure that the union is aligned to the largest member, so my understandin

Re: [Libevent-users] Adding ipv6 support.

2011-02-07 Thread Tommy van Leeuwen
On Mon, Feb 7, 2011 at 12:58 PM, Ron Arts wrote: > hi, > > I have an application where I need to add ipv6 support. > Does a recipe exist, or example code how to convert > an existing libevent application? This helped me a lot on porting my ipv4 apps to ipv6: http://www.akkadia.org/drepper/userap

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] Adding ipv6 support.

2011-02-07 Thread Dave Hart
On Mon, Feb 7, 2011 at 17:53 UTC, 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 { typedef union union_saddr_tag { ... Not enough coffee. Running the microwave to reheat it irritates my 2.5 GHz wi

Re: [Libevent-users] Adding ipv6 support.

2011-02-07 Thread Dave Hart
Frank's advice is a great overview of how to approach the problem. sockaddr_storage provides enough storage space for any platform-supported socket family, but in some cases I've found it to be too generous, much larger than sockaddr_in6, the largest I care about. Also, I don't like the typical ca

Re: [Libevent-users] Adding ipv6 support.

2011-02-07 Thread Frank Denis
Hi Ron, Le Mon, Feb 07, 2011 at 12:58:47PM +0100, Ron Arts ecrivait : > I have an application where I need to add ipv6 support. > Does a recipe exist, or example code how to convert > an existing libevent application? Libevent does support IPv6 for a long time, possibly since the very first p

[Libevent-users] Adding ipv6 support.

2011-02-07 Thread Ron Arts
hi, I have an application where I need to add ipv6 support. Does a recipe exist, or example code how to convert an existing libevent application? thanks, Ron *** To unsubscribe, send an e-mail to majord...@freehaven.net with uns